The class representing a 4x4 matrix.

Constructors

  • Create a 4x4 matrix with the given arguments in row-major order. If no arguments are provided, the constructor initializes the Matrix4 to the 4x4 identity matrix.

    Parameters

    • Optionaln11: number

      Input element in the first row and the first column

    • Optionaln12: number

      Input element in the first row and the second column

    • Optionaln13: number

      Input element in the first row and the third column

    • Optionaln14: number

      Input element in the first row and the forth column

    • Optionaln21: number

      Input element in the second row and the first column

    • Optionaln22: number

      Input element in the second row and the second column

    • Optionaln23: number

      Input element in the second row and the third column

    • Optionaln24: number

      Input element in the second row and the forth column

    • Optionaln31: number

      Input element in the third row and the first column

    • Optionaln32: number

      Input element in the third row and the second column

    • Optionaln33: number

      Input element in the third row and the third column

    • Optionaln34: number

      Input element in the third row and the forth column

    • Optionaln41: number

      Input element in the forth row and the first column

    • Optionaln42: number

      Input element in the forth row and the second column

    • Optionaln43: number

      Input element in the forth row and the third column

    • Optionaln44: number

      Input element in the forth row and the forth column

    Returns AcGeMatrix3d

Properties

elements: number[]

A column-major list of matrix values.

IDENTITY: Readonly<AcGeMatrix3d> = ...

Identity matrix.

Methods

  • Decompose this matrix into its position, quaternion and scale components.

    Note: Not all matrices are decomposable in this way. For example, if an object has a non-uniformly scaled parent, then the object's world matrix may not be decomposable, and this method may not be appropriate.

    Parameters

    Returns AcGeMatrix3d

    Return this matrix

  • Compute and return the determinant of this matrix.

    Returns number

    Return the determinant of this matrix.

  • Set the elements of this matrix based on an array in column-major format.

    Parameters

    • array: number[]

      Input the array to read the elements from.

    • offset: number = 0

      Input (optional) offset into the array. Default is 0.

    Returns AcGeMatrix3d

  • Get the maximum scale value of the 3 axes.

    Returns number

    Return the maximum scale value of the 3 axes.

  • Invert this matrix, using the analytic method. You can not invert with a determinant of zero. If you attempt this, the method produces a zero matrix instead.

    Returns AcGeMatrix3d

    Return this matrix

  • Set this matrix as a rotational transformation around the X axis by theta (θ) radians.

    Parameters

    • theta: number

      Input rotation angle in radians.

    Returns AcGeMatrix3d

    Return this matrix

  • Set this matrix as a rotational transformation around the Y axis by theta (θ) radians.

    Parameters

    • theta: number

      Input rotation angle in radians.

    Returns AcGeMatrix3d

    Return this matrix

  • Set this matrix as a rotational transformation around the Z axis by theta (θ) radians.

    Parameters

    • theta: number

      Input rotation angle in radians.

    Returns AcGeMatrix3d

    Return this matrix

  • Set this matrix as scale transform.

    Parameters

    • x: number

      Input x scale

    • y: number

      Input y scale

    • z: number

      Input z scale

    Returns AcGeMatrix3d

    Return this matrix

  • Set this matrix as a shear transform.

    Parameters

    • xy: number

      Input the amount to shear X by Y.

    • xz: number

      Input the amount to shear X by Z.

    • yx: number

      Input the amount to shear Y by X.

    • yz: number

      Input the amount to shear Y by Z.

    • zx: number

      Input the amount to shear Z by X.

    • zy: number

      Input the amount to shear Z by Y.

    Returns AcGeMatrix3d

    Return this matrix

  • Set this matrix as a translation transform from vector v, or numbers x, y and z.

    Parameters

    • x: number | AcGeVector3d

      Input one vector or one number

    • Optionaly: number

      Input one number

    • Optionalz: number

      Input one number

    Returns AcGeMatrix3d

    Return this matrix

  • Set the elements of this matrix to the supplied row-major values n11, n12, ... n44.

    Parameters

    • n11: number

      Input element in the first row and the first column

    • n12: number

      Input element in the first row and the second column

    • n13: number

      Input element in the first row and the third column

    • n14: number

      Input element in the first row and the forth column

    • n21: number

      Input element in the second row and the first column

    • n22: number

      Input element in the second row and the second column

    • n23: number

      Input element in the second row and the third column

    • n24: number

      Input element in the second row and the forth column

    • n31: number

      Input element in the third row and the first column

    • n32: number

      Input element in the third row and the second column

    • n33: number

      Input element in the third row and the third column

    • n34: number

      Input element in the third row and the forth column

    • n41: number

      Input element in the forth row and the first column

    • n42: number

      Input element in the forth row and the second column

    • n43: number

      Input element in the forth row and the third column

    • n44: number

      Input element in the forth row and the forth column

    Returns AcGeMatrix3d

    Return this matrix

  • Set the position component for this matrix from vector v, without affecting the rest of the matrix.

    Parameters

    • x: number | AcGeVector3d

      Input one number or one vector

    • y: number

      Input one number

    • z: number

      Input one number

    Returns AcGeMatrix3d

    Return this matrix

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

    Parameters

    • array: number[] = []

      Input (optional) array to store the resulting vector in.

    • offset: number = 0

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

    Returns number[]

    Return an array in column-major format by writing the elements of this matrix to it