Selva Compute API Reference - v1.1.2
    Preparing search index...

    A 4x4 Matrix.

    // Simple rig for rotating around 3 axes
    const m = new THREE.Matrix4();
    const m1 = new THREE.Matrix4();
    const m2 = new THREE.Matrix4();
    const m3 = new THREE.Matrix4();
    const alpha = 0;
    const beta = Math.PI;
    const gamma = Math.PI/2;
    m1.makeRotationX( alpha );
    m2.makeRotationY( beta );
    m3.makeRotationZ( gamma );
    m.multiplyMatrices( m1, m2 );
    m.multiply( m3 );
    Index

    Constructors

    • Creates an identity matrix.

      Returns Matrix4

    • Creates a 4x4 matrix with the given arguments in row-major order.

      Parameters

      • n11: number
      • n12: number
      • n13: number
      • n14: number
      • n21: number
      • n22: number
      • n23: number
      • n24: number
      • n31: number
      • n32: number
      • n33: number
      • n34: number
      • n41: number
      • n42: number
      • n43: number
      • n44: number

      Returns Matrix4

    Properties

    elements: Matrix4Tuple

    Array with matrix values.

    [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
    
    isMatrix4: true

    Methods

    • Returns Matrix4

    • Sets this matrix to the transformation composed of translation, rotation and scale.

      Parameters

      Returns this

    • Parameters

      Returns this

    • Parameters

      Returns this

    • Decomposes this matrix into it's position, quaternion and scale components.

      Parameters

      Returns this

    • Parameters

      Returns boolean

    • Parameters

      Returns this

    • Copies the rotation component of the supplied matrix m into this matrix rotation component.

      Parameters

      Returns this

    • Sets the values of this matrix from the provided array or array-like.

      Parameters

      • array: ArrayLike<number>

        the source array or array-like.

      • Optionaloffset: number

        (optional) offset into the array-like. Default is 0.

      Returns this

    • Returns number

    • Resets this matrix to identity.

      Returns this

    • Inverts this matrix.

      Returns this

    • Sets the rotation component of the transformation matrix, looking from [eye]Vector3 towards [target]Vector3, and oriented by the up-direction [up]Vector3.

      Parameters

      Returns this

    • Parameters

      Returns this

    • Creates an orthographic projection matrix.

      Parameters

      • left: number
      • right: number
      • top: number
      • bottom: number
      • near: number
      • far: number
      • OptionalcoordinateSystem: CoordinateSystem
      • OptionalreversedDepth: boolean

      Returns this

    • Creates a perspective projection matrix.

      Parameters

      • left: number
      • right: number
      • top: number
      • bottom: number
      • near: number
      • far: number
      • OptionalcoordinateSystem: CoordinateSystem
      • OptionalreversedDepth: boolean

      Returns this

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

      Parameters

      • axis: Vector3

        Rotation axis.

      • angle: number

        Rotation angle in radians.

      Returns this

    • Parameters

      Returns this

    • Parameters

      Returns this

    • Sets this matrix as rotation transform around x axis by theta radians.

      Parameters

      • theta: number

        Rotation angle in radians.

      Returns this

    • Sets this matrix as rotation transform around y axis by theta radians.

      Parameters

      • theta: number

        Rotation angle in radians.

      Returns this

    • Sets this matrix as rotation transform around z axis by theta radians.

      Parameters

      • theta: number

        Rotation angle in radians.

      Returns this

    • Sets this matrix as scale transform.

      Parameters

      • x: number
      • y: number
      • z: number

      Returns this

    • Sets this matrix as shear transform.

      Parameters

      • xy: number
      • xz: number
      • yx: number
      • yz: number
      • zx: number
      • zy: number

      Returns this

    • Sets this matrix as translation transform.

      Parameters

      Returns this

    • Sets this matrix as translation transform.

      Parameters

      • x: number
      • y: number
      • z: number

      Returns this

    • Multiplies this matrix by m.

      Parameters

      Returns this

    • Sets this matrix to a x b.

      Parameters

      Returns this

    • Multiplies this matrix by s.

      Parameters

      • s: number

      Returns this

    • Parameters

      Returns this

    • Multiplies the columns of this matrix by vector v.

      Parameters

      Returns this

    • Sets all fields of this matrix.

      Parameters

      • n11: number
      • n12: number
      • n13: number
      • n14: number
      • n21: number
      • n22: number
      • n23: number
      • n24: number
      • n31: number
      • n32: number
      • n33: number
      • n34: number
      • n41: number
      • n42: number
      • n43: number
      • n44: number

      Returns this

    • Set the upper 3x3 elements of this matrix to the values of the Matrix3 m.

      Parameters

      Returns this

    • Sets the position component for this matrix from vector v.

      Parameters

      Returns this

    • Sets the position component for this matrix from vector v.

      Parameters

      • x: number
      • y: number
      • z: number

      Returns this

    • Writes the elements of this matrix to an array in column-major format.

      Returns Matrix4Tuple

    • Writes the elements of this matrix to an array in column-major format.

      Type Parameters

      Parameters

      • array: TArray

        array to store the resulting vector in.

      • Optionaloffset: number

        (optional) offset in the array at which to put the result.

      Returns TArray

    • Transposes this matrix.

      Returns this