Class Matrix4

Represents a 4x4 mathematical matrix.

Hierarchy

  • Matrix4

Constructors

  • Constructor of 4x4 Matrix4.

    Parameters

    • m11: number = 1

      default 1, column 1, row 1

    • m12: number = 0

      default 0, column 1, row 2

    • m13: number = 0

      default 0, column 1, row 3

    • m14: number = 0

      default 0, column 1, row 4

    • m21: number = 0

      default 0, column 2, row 1

    • m22: number = 1

      default 1, column 2, row 2

    • m23: number = 0

      default 0, column 2, row 3

    • m24: number = 0

      default 0, column 2, row 4

    • m31: number = 0

      default 0, column 3, row 1

    • m32: number = 0

      default 0, column 3, row 2

    • m33: number = 1

      default 1, column 3, row 3

    • m34: number = 0

      default 0, column 3, row 4

    • m41: number = 0

      default 0, column 4, row 1

    • m42: number = 0

      default 0, column 4, row 2

    • m43: number = 0

      default 0, column 4, row 3

    • m44: number = 1

      default 1, column 4, row 4

    Returns Matrix4

Properties

elements: Float32Array = ...

An array containing the elements of the matrix (column matrix).

Remarks

elements[0] first column and first row value m11 elements[1] first column and second row value m12 elements[2] first column and third row value m13 elements[3] first column and fourth row value m14 elements[4] second column and first row value m21 and so on

_identity: Matrix4 = ...

Identity matrix.

_tempMat30: Matrix3 = ...
_tempVec30: Vector3 = ...
_tempVec31: Vector3 = ...
_tempVec32: Vector3 = ...

Methods

  • Decompose this matrix to translation, rotation and scale elements.

    Returns

    True if this matrix can be decomposed, false otherwise

    Parameters

    • translation: Vector3

      Translation vector as an output parameter

    • rotation: Quaternion

      Rotation quaternion as an output parameter

    • scale: Vector3

      Scale vector as an output parameter

    Returns boolean

  • Calculate a determinant of this matrix.

    Returns

    The determinant of this matrix

    Returns number

  • Determines the product of this matrix and the specified matrix.

    Returns

    This matrix that store the product of the two matrices

    Parameters

    • right: Matrix4

      The specified matrix

    Returns Matrix4

  • This matrix rotates around an arbitrary axis.

    Returns

    This matrix after rotate

    Parameters

    • axis: Vector3

      The axis

    • r: number

      The rotation angle in radians

    Returns Matrix4

  • Set the value of this matrix, and return this matrix.

    Returns

    This matrix

    Parameters

    • m11: number

      column 1, row 1

    • m12: number

      column 1, row 2

    • m13: number

      column 1, row 3

    • m14: number

      column 1, row 4

    • m21: number

      column 2, row 1

    • m22: number

      column 2, row 2

    • m23: number

      column 2, row 3

    • m24: number

      column 2, row 4

    • m31: number

      column 3, row 1

    • m32: number

      column 3, row 2

    • m33: number

      column 3, row 3

    • m34: number

      column 3, row 4

    • m41: number

      column 4, row 1

    • m42: number

      column 4, row 2

    • m43: number

      column 4, row 3

    • m44: number

      column 4, row 4

    Returns Matrix4

  • Set the value of this matrix by an array.

    Returns

    This matrix

    Parameters

    • array: ArrayLike<number>

      The array

    • offset: number = 0

      The start offset of the array

    Returns Matrix4

  • Clone the value of this matrix to an array.

    Parameters

    • out: Float32Array | Float64Array | number[]

      The array

    • outOffset: number = 0

      The start offset of the array

    Returns void

  • Determines whether the specified matrices are equals.

    Returns

    True if the specified matrices are equals, false otherwise

    Parameters

    • left: Matrix4

      The first matrix to compare

    • right: Matrix4

      The second matrix to compare

    Returns boolean

  • Calculate the inverse of the specified matrix.

    Parameters

    • a: Matrix4

      The matrix whose inverse is to be calculated

    • out: Matrix4

      The inverse of the specified matrix

    Returns void

  • Performs a linear interpolation between two matrices.

    Parameters

    • start: Matrix4

      The first matrix

    • end: Matrix4

      The second matrix

    • t: number

      The blend amount where 0 returns start and 1 end

    • out: Matrix4

      The result of linear blending between two matrices

    Returns void

  • Calculate an orthographic projection matrix.

    Parameters

    • left: number

      The left edge of the viewing

    • right: number

      The right edge of the viewing

    • bottom: number

      The bottom edge of the viewing

    • top: number

      The top edge of the viewing

    • near: number

      The depth of the near plane

    • far: number

      The depth of the far plane

    • out: Matrix4

      The calculated orthographic projection matrix

    Returns void

  • Calculate a perspective projection matrix.

    Parameters

    • fovY: number

      Field of view in the y direction, in radians

    • aspect: number

      Aspect ratio, defined as view space width divided by height

    • near: number

      The depth of the near plane

    • far: number

      The depth of the far plane

    • out: Matrix4

      The calculated perspective projection matrix

    Returns void

  • The specified matrix rotates around an arbitrary axis.

    Parameters

    • m: Matrix4

      The specified matrix

    • axis: Vector3

      The axis

    • r: number

      The rotation angle in radians

    • out: Matrix4

      The rotated matrix

    Returns void

  • Calculate a matrix rotates around an arbitrary axis.

    Parameters

    • axis: Vector3

      The axis

    • r: number

      The rotation angle in radians

    • out: Matrix4

      The matrix after rotate

    Returns void

  • Calculate a rotation matrix from a quaternion.

    Parameters

    • quaternion: Quaternion

      The quaternion used to calculate the matrix

    • out: Matrix4

      The calculated rotation matrix

    Returns void

  • Calculate a matrix from a quaternion and a translation.

    Parameters

    • quaternion: Quaternion

      The quaternion used to calculate the matrix

    • translation: Vector3

      The translation used to calculate the matrix

    • out: Matrix4

      The calculated matrix

    Returns void

Generated using TypeDoc