[name]

A 4x4 Matrix.

Example

// Simple rig for rotating around 3 axes var m = new THREE.Matrix4(); var m1 = new THREE.Matrix4(); var m2 = new THREE.Matrix4(); var m3 = new THREE.Matrix4(); var alpha = 0; var beta = Math.PI; var gamma = Math.PI/2; m1.setRotationX( alpha ); m2.setRotationY( beta ); m3.setRotationZ( gamma ); m.multiply( m1, m2 ); m.multiplySelf( m3 );

Constructor

[name]( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] )

Properties

.[page:Float n11]

.[page:Float n12]

.[page:Float n13]

.[page:Float n14]

.[page:Float n21]

.[page:Float n22]

.[page:Float n23]

.[page:Float n24]

.[page:Float n31]

.[page:Float n32]

.[page:Float n33]

.[page:Float n34]

.[page:Float n41]

.[page:Float n42]

.[page:Float n43]

.[page:Float n44]

Methods

.set( [page:Float n11], [page:Float n12], [page:Float n13], [page:Float n14], [page:Float n21], [page:Float n22], [page:Float n23], [page:Float n24], [page:Float n31], [page:Float n32], [page:Float n33], [page:Float n34], [page:Float n41], [page:Float n42], [page:Float n43], [page:Float n44] ) [page:Matrix4]

Sets all fields of this matrix.

.identity() [page:Matrix4]

Resets this matrix to identity.

.copy( [page:Matrix4 m] ) [page:Matrix4]

Copies a matrix m into this matrix.

.lookAt( [page:Vector3 eye], [page:Vector3 center], [page:Vector3 up], ) [page:Matrix4]

Constructs a rotation matrix, looking from eye towards center with defined up vector.

.multiply( [page:Matrix4 a], [page:Matrix4 b] ) [page:Matrix4]

Sets this matrix to a * b.

.multiplySelf( [page:Matrix4 m] ) [page:Matrix4]

Multiplies this matrix by m.

.multiplyToArray( [page:Matrix4 a], [page:Matrix4 b], [page:Array r] ) [page:Matrix4]

Sets this matrix to a * b and sets result into flat array r.
Destination array can be regular Array or TypedArray.

.multiplyScalar( [page:Float s] ) [page:Matrix4]

Multiplies this matrix by s.

.multiplyVector3( [page:Vector3 v] ) [page:Vector3]

Applies this matrix to v.

.multiplyVector4( [page:Vector4 v] ) [page:Vector4]

Applies this matrix to v.

.rotateAxis( [page:Vector3 v] ) [page:Vector3]

Applies rotation submatrix of this matrix to vector v and then normalizes it.

.crossVector( [page:Vector4 a] ) [page:Vector4]

.determinant() [page:Float]

Computes determinant of this matrix.
Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm

.transpose() [page:Matrix4]

Transposes this matrix.

.flatten() [page:Array]

Flattens this matrix into internal [page:Matrix4 Matrix4.flat] array.

.flattenToArray( [page:Array flat] ) [page:Array]

Flattens this matrix into supplied flat array.

.flattenToArrayOffset( [page:Array flat], [page:Integer offset] ) [page:Array]

Flattens this matrix into supplied flat array starting from offset position in the array.

.setTranslation( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4]

Sets this matrix as translation transform.

.setScale( [page:Float x], [page:Float y], [page:Float z] ) [page:Matrix4]

Sets this matrix as scale transform.

.setRotationX( [page:Float theta] ) [page:Matrix4]

theta — Rotation angle in radians.
Sets this matrix as rotation transform around x axis by theta radians.

.setRotationY( [page:Float theta] ) [page:Matrix4]

theta — Rotation angle in radians.
Sets this matrix as rotation transform around y axis by theta radians.

.setRotationZ( [page:Float theta] ) [page:Matrix4]

theta — Rotation angle in radians.
Sets this matrix as rotation transform around z axis by theta radians.

.setRotationAxis( [page:Vector3 axis], [page:Float theta] ) [page:Matrix4]

axis — Rotation axis. theta — Rotation angle in radians.
Sets this matrix as rotation transform around axis by angle radians.
Based on http://www.gamedev.net/reference/articles/article1199.asp.

.setPosition( [page:Vector3 v] ) [page:Matrix4]

Sets the position component for this matrix from vector v.

.getPosition() [page:Vector3]

Returns position component from this matrix.
Note: this method returns a reference to internal class vector, make copy or clone if you don't use it right away.

.getColumnX() [page:Vector3]

Returns x column component from this matrix.
Note: this method returns a reference to internal class vector, make copy or clone if you don't use it right away.

.getColumnY() [page:Vector3]

Returns y column component from this matrix.
Note: this method returns a reference to internal class vector, make copy or clone if you don't use it right away.

.getColumnZ() [page:Vector3]

Returns z column component from this matrix.
Note: this method returns a reference to internal class vector, make copy or clone if you don't use it right away.

.getInverse( [page:Matrix4 m] ) [page:Matrix4]

Sets this matrix to inverse of matrix m.
Based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm.

.setRotationFromEuler( [page:Vector3 v], [page:String order] ) [page:Matrix4]

v — Rotation vector. order — The order of rotations. Eg. "XYZ".
Sets rotation submatrix of this matrix to rotation specified by Euler angles.
Default order "XYZ".

.setRotationFromQuaternion( [page:Quaternion q] ) [page:Matrix4]

Sets rotation submatrix of this matrix to rotation specified by q.

.scale( [page:Vector3 v] ) [page:Matrix4]

Multiplies columns of this matrix by vector v.

.compose( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Matrix4]

Sets this matrix to transform composed of translation, rotation and scale.

.decompose( [page:Vector3 translation], [page:Quaternion rotation], [page:Vector3 scale] ) [page:Array]

Decomposes this matrix into translation, rotation and scale components.
If parameters are not supplied, new instances will be created.

Source

src/[path].js