Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Matrix

Class used to store matrix data (4x4)

Hierarchy

  • Matrix

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Creates an empty matrix (filled with zeros)

    Returns Matrix

Properties

updateFlagSearch playground for updateFlag

updateFlag: number

Gets the update flag of the matrix which is an unique number for the matrix. It will be incremented every time the matrix data change. You can use it to speed the comparison between two versions of the same matrix.

Accessors

m

  • Gets the internal data of the matrix

    Returns DeepImmutable<Float32Array | Array<number>>

Static IdentityReadOnly

  • Gets an identity matrix that must not be updated

    Returns DeepImmutable<Matrix>

Static Use64Bits

  • get Use64Bits(): boolean
  • Gets the precision of matrix computations

    Returns boolean

Methods

addSearch playground for add

  • Adds the current matrix with a second one

    Parameters

    Returns Matrix

    a new matrix as the addition of the current matrix and the given one

addAtIndexSearch playground for addAtIndex

  • addAtIndex(index: number, value: number): Matrix
  • add a value at the specified position in the current Matrix

    Parameters

    • index: number

      the index of the value within the matrix. between 0 and 15.

    • value: number

      the value to be added

    Returns Matrix

    the current updated matrix

addToRefSearch playground for addToRef

  • Sets the given matrix "result" to the addition of the current matrix and the given one

    Parameters

    Returns Matrix

    the current matrix

addToSelfSearch playground for addToSelf

  • Adds in place the given matrix to the current matrix

    Parameters

    Returns Matrix

    the current updated matrix

addTranslationFromFloatsSearch playground for addTranslationFromFloats

  • addTranslationFromFloats(x: number, y: number, z: number): Matrix
  • Adds the translation vector (using 3 floats) in the current matrix

    Parameters

    • x: number

      defines the 1st component of the translation

    • y: number

      defines the 2nd component of the translation

    • z: number

      defines the 3rd component of the translation

    Returns Matrix

    the current updated matrix

asArray

Returns the matrix as a Float32Array or Array

Returns DeepImmutable<Float32Array | Array<number>>

the matrix underlying array.

cloneSearch playground for clone

  • Clone the current matrix

    Returns Matrix

    a new matrix from the current matrix

copyFromSearch playground for copyFrom

  • Copy the current matrix from the given one

    Parameters

    Returns Matrix

    the current updated matrix

copyToArraySearch playground for copyToArray

  • copyToArray(array: Float32Array | Array<number>, offset?: number): Matrix
  • Populates the given array from the starting index with the current matrix values

    Parameters

    • array: Float32Array | Array<number>

      defines the target array

    • Optional offset: number

      defines the offset in the target array where to start storing values

    Returns Matrix

    the current matrix

decomposeSearch playground for decompose

  • Decomposes the current Matrix into a translation, rotation and scaling components

    Parameters

    • Optional scale: Vector3

      defines the scale vector3 given as a reference to update

    • Optional rotation: Quaternion

      defines the rotation quaternion given as a reference to update

    • Optional translation: Vector3

      defines the translation vector3 given as a reference to update

    Returns boolean

    true if operation was successful

decomposeToTransformNodeSearch playground for decomposeToTransformNode

  • Decomposes the current Matrix into a translation, rotation and scaling components of the provided node

    Parameters

    Returns boolean

    true if operation was successful

determinantSearch playground for determinant

  • determinant(): number
  • Gets the determinant of the matrix

    Returns number

    the matrix determinant

equalsSearch playground for equals

  • Check equality between this matrix and a second one

    Parameters

    Returns boolean

    true is the current matrix and the given one values are strictly equal

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Returns the name of the current matrix class

    Returns string

    the string "Matrix"

getHashCodeSearch playground for getHashCode

  • getHashCode(): number
  • Gets the hash code of the current matrix

    Returns number

    the hash code

getRotationMatrixSearch playground for getRotationMatrix

  • Gets only rotation part of the current matrix

    Returns Matrix

    a new matrix sets to the extracted rotation matrix from the current one

getRotationMatrixToRefSearch playground for getRotationMatrixToRef

  • Extracts the rotation matrix from the current one and sets it as the given "result"

    Parameters

    • result: Matrix

      defines the target matrix to store data to

    Returns Matrix

    the current matrix

getRowSearch playground for getRow

  • Gets specific row of the matrix

    Parameters

    • index: number

      defines the number of the row to get

    Returns Nullable<Vector4>

    the index-th row of the current matrix as a new Vector4

getTranslationSearch playground for getTranslation

  • Gets the translation value of the current matrix

    Returns Vector3

    a new Vector3 as the extracted translation from the matrix

getTranslationToRefSearch playground for getTranslationToRef

  • Fill a Vector3 with the extracted translation from the matrix

    Parameters

    • result: Vector3

      defines the Vector3 where to store the translation

    Returns Matrix

    the current matrix

invertSearch playground for invert

  • Inverts the current matrix in place

    Returns Matrix

    the current inverted matrix

invertToRefSearch playground for invertToRef

  • Sets the given matrix to the current inverted Matrix

    Parameters

    • other: Matrix

      defines the target matrix

    Returns Matrix

    the unmodified current matrix

isIdentitySearch playground for isIdentity

  • isIdentity(): boolean
  • Check if the current matrix is identity

    Returns boolean

    true is the matrix is the identity matrix

isIdentityAs3x2Search playground for isIdentityAs3x2

  • isIdentityAs3x2(): boolean
  • Check if the current matrix is identity as a texture matrix (3x2 store in 4x4)

    Returns boolean

    true is the matrix is the identity matrix

multiplySearch playground for multiply

  • Multiply two matrices

    Parameters

    Returns Matrix

    a new matrix set with the multiplication result of the current Matrix and the given one

multiplyAtIndexSearch playground for multiplyAtIndex

  • multiplyAtIndex(index: number, value: number): Matrix
  • mutiply the specified position in the current Matrix by a value

    Parameters

    • index: number

      the index of the value within the matrix. between 0 and 15.

    • value: number

      the value to be added

    Returns Matrix

    the current updated matrix

multiplyToArraySearch playground for multiplyToArray

  • Sets the Float32Array "result" from the given index "offset" with the multiplication of the current matrix and the given one

    Parameters

    • other: DeepImmutable<Matrix>

      defines the second operand

    • result: Float32Array | Array<number>

      defines the array where to store the multiplication

    • offset: number

      defines the offset in the target array where to start storing values

    Returns Matrix

    the current matrix

multiplyToRefSearch playground for multiplyToRef

  • Sets the given matrix "result" with the multiplication result of the current Matrix and the given one

    Parameters

    • other: DeepImmutable<Matrix>

      defines the second operand

    • result: Matrix

      defines the matrix where to store the multiplication

    Returns Matrix

    the current matrix

removeRotationAndScalingSearch playground for removeRotationAndScaling

  • removeRotationAndScaling(): Matrix
  • Remove rotation and scaling part from the matrix

    Returns Matrix

    the updated matrix

resetSearch playground for reset

  • Sets all the matrix elements to zero

    Returns Matrix

    the current matrix

scaleSearch playground for scale

  • scale(scale: number): Matrix
  • Compute a new matrix set with the current matrix values multiplied by scale (float)

    Parameters

    • scale: number

      defines the scale factor

    Returns Matrix

    a new matrix

scaleAndAddToRefSearch playground for scaleAndAddToRef

  • Scale the current matrix values by a factor and add the result to a given matrix

    Parameters

    • scale: number

      defines the scale factor

    • result: Matrix

      defines the Matrix to store the result

    Returns Matrix

    the current matrix

scaleToRefSearch playground for scaleToRef

  • Scale the current matrix values by a factor to a given result matrix

    Parameters

    • scale: number

      defines the scale factor

    • result: Matrix

      defines the matrix to store the result

    Returns Matrix

    the current matrix

setRowSearch playground for setRow

  • Sets the index-th row of the current matrix to the vector4 values

    Parameters

    • index: number

      defines the number of the row to set

    • row: Vector4

      defines the target vector4

    Returns Matrix

    the updated current matrix

setRowFromFloatsSearch playground for setRowFromFloats

  • setRowFromFloats(index: number, x: number, y: number, z: number, w: number): Matrix
  • Sets the index-th row of the current matrix with the given 4 x float values

    Parameters

    • index: number

      defines the row index

    • x: number

      defines the x component to set

    • y: number

      defines the y component to set

    • z: number

      defines the z component to set

    • w: number

      defines the w component to set

    Returns Matrix

    the updated current matrix

setTranslationSearch playground for setTranslation

  • Inserts the translation vector in the current matrix

    Parameters

    Returns Matrix

    the current updated matrix

setTranslationFromFloatsSearch playground for setTranslationFromFloats

  • setTranslationFromFloats(x: number, y: number, z: number): Matrix
  • Inserts the translation vector (using 3 floats) in the current matrix

    Parameters

    • x: number

      defines the 1st component of the translation

    • y: number

      defines the 2nd component of the translation

    • z: number

      defines the 3rd component of the translation

    Returns Matrix

    the current updated matrix

toArray

Returns the matrix as a Float32Array or Array

Returns DeepImmutable<Float32Array | Array<number>>

the matrix underlying array

toNormalMatrixSearch playground for toNormalMatrix

  • toNormalMatrix(ref: Matrix): void
  • Writes to the given matrix a normal matrix, computed from this one (using values from identity matrix for fourth row and column).

    Parameters

    • ref: Matrix

      matrix to store the result

    Returns void

toggleModelMatrixHandInPlaceSearch playground for toggleModelMatrixHandInPlace

  • toggleModelMatrixHandInPlace(): void
  • Toggles model matrix from being right handed to left handed in place and vice versa

    Returns void

toggleProjectionMatrixHandInPlaceSearch playground for toggleProjectionMatrixHandInPlace

  • toggleProjectionMatrixHandInPlace(): void
  • Toggles projection matrix from being right handed to left handed in place and vice versa

    Returns void

transposeSearch playground for transpose

  • Compute the transpose of the matrix

    Returns Matrix

    the new transposed matrix

transposeToRefSearch playground for transposeToRef

  • Compute the transpose of the matrix and store it in a given matrix

    Parameters

    • result: Matrix

      defines the target matrix

    Returns Matrix

    the current matrix

Static ComposeSearch playground for Compose

  • Creates a new matrix composed by merging scale (vector3), rotation (quaternion) and translation (vector3)

    Parameters

    Returns Matrix

    a new matrix

Static ComposeToRefSearch playground for ComposeToRef

  • Sets a matrix to a value composed by merging scale (vector3), rotation (quaternion) and translation (vector3)

    Parameters

    Returns void

Static DecomposeLerpSearch playground for DecomposeLerp

  • Builds a new matrix whose values are computed by:

    • decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
    • interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end
    • recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices

    Parameters

    Returns Matrix

    the new matrix

Static DecomposeLerpToRefSearch playground for DecomposeLerpToRef

  • Update a matrix to values which are computed by:

    • decomposing the the "startValue" and "endValue" matrices into their respective scale, rotation and translation matrices
    • interpolating for "gradient" (float) the values between each of these decomposed matrices between the start and the end
    • recomposing a new matrix from these 3 interpolated scale, rotation and translation matrices

    Parameters

    • startValue: DeepImmutable<Matrix>

      defines the first matrix

    • endValue: DeepImmutable<Matrix>

      defines the second matrix

    • gradient: number

      defines the gradient between the two matrices

    • result: Matrix

      defines the target matrix

    Returns void

Static FromArraySearch playground for FromArray

  • Creates a matrix from an array

    Parameters

    • array: DeepImmutable<ArrayLike<number>>

      defines the source array

    • Optional offset: number

      defines an offset in the source array

    Returns Matrix

    a new Matrix set from the starting index of the given array

Static FromArrayToRefSearch playground for FromArrayToRef

  • FromArrayToRef(array: DeepImmutable<ArrayLike<number>>, offset: number, result: Matrix): void
  • Copy the content of an array into a given matrix

    Parameters

    • array: DeepImmutable<ArrayLike<number>>

      defines the source array

    • offset: number

      defines an offset in the source array

    • result: Matrix

      defines the target matrix

    Returns void

Static FromFloat32ArrayToRefScaledSearch playground for FromFloat32ArrayToRefScaled

  • FromFloat32ArrayToRefScaled(array: DeepImmutable<Float32Array | Array<number>>, offset: number, scale: number, result: Matrix): void
  • Stores an array into a matrix after having multiplied each component by a given factor

    Parameters

    • array: DeepImmutable<Float32Array | Array<number>>

      defines the source array

    • offset: number

      defines the offset in the source array

    • scale: number

      defines the scaling factor

    • result: Matrix

      defines the target matrix

    Returns void

Static FromQuaternionToRefSearch playground for FromQuaternionToRef

  • Creates a rotation matrix from a quaternion and stores it in a target matrix

    Parameters

    Returns void

Static FromValuesSearch playground for FromValues

  • FromValues(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number): Matrix
  • Creates new matrix from a list of values (16)

    Parameters

    • initialM11: number

      defines 1st value of 1st row

    • initialM12: number

      defines 2nd value of 1st row

    • initialM13: number

      defines 3rd value of 1st row

    • initialM14: number

      defines 4th value of 1st row

    • initialM21: number

      defines 1st value of 2nd row

    • initialM22: number

      defines 2nd value of 2nd row

    • initialM23: number

      defines 3rd value of 2nd row

    • initialM24: number

      defines 4th value of 2nd row

    • initialM31: number

      defines 1st value of 3rd row

    • initialM32: number

      defines 2nd value of 3rd row

    • initialM33: number

      defines 3rd value of 3rd row

    • initialM34: number

      defines 4th value of 3rd row

    • initialM41: number

      defines 1st value of 4th row

    • initialM42: number

      defines 2nd value of 4th row

    • initialM43: number

      defines 3rd value of 4th row

    • initialM44: number

      defines 4th value of 4th row

    Returns Matrix

    the new matrix

Static FromValuesToRefSearch playground for FromValuesToRef

  • FromValuesToRef(initialM11: number, initialM12: number, initialM13: number, initialM14: number, initialM21: number, initialM22: number, initialM23: number, initialM24: number, initialM31: number, initialM32: number, initialM33: number, initialM34: number, initialM41: number, initialM42: number, initialM43: number, initialM44: number, result: Matrix): void
  • Stores a list of values (16) inside a given matrix

    Parameters

    • initialM11: number

      defines 1st value of 1st row

    • initialM12: number

      defines 2nd value of 1st row

    • initialM13: number

      defines 3rd value of 1st row

    • initialM14: number

      defines 4th value of 1st row

    • initialM21: number

      defines 1st value of 2nd row

    • initialM22: number

      defines 2nd value of 2nd row

    • initialM23: number

      defines 3rd value of 2nd row

    • initialM24: number

      defines 4th value of 2nd row

    • initialM31: number

      defines 1st value of 3rd row

    • initialM32: number

      defines 2nd value of 3rd row

    • initialM33: number

      defines 3rd value of 3rd row

    • initialM34: number

      defines 4th value of 3rd row

    • initialM41: number

      defines 1st value of 4th row

    • initialM42: number

      defines 2nd value of 4th row

    • initialM43: number

      defines 3rd value of 4th row

    • initialM44: number

      defines 4th value of 4th row

    • result: Matrix

      defines the target matrix

    Returns void

Static FromXYZAxesToRefSearch playground for FromXYZAxesToRef

  • Sets the given matrix as a rotation matrix composed from the 3 left handed axes

    Parameters

    Returns void

Static GetAsMatrix2x2Search playground for GetAsMatrix2x2

  • Extracts a 2x2 matrix from a given matrix and store the result in a Float32Array

    Parameters

    Returns Float32Array | Array<number>

    a new Float32Array array with 4 elements : the 2x2 matrix extracted from the given matrix

Static GetAsMatrix3x3Search playground for GetAsMatrix3x3

  • Extracts a 3x3 matrix from a given matrix and store the result in a Float32Array

    Parameters

    Returns Float32Array | Array<number>

    a new Float32Array array with 9 elements : the 3x3 matrix extracted from the given matrix

Static GetFinalMatrixSearch playground for GetFinalMatrix

  • Computes a complete transformation matrix

    Parameters

    Returns Matrix

    the transformation matrix

Static IdentitySearch playground for Identity

  • Creates a new identity matrix

    Returns Matrix

    a new identity matrix

Static IdentityToRefSearch playground for IdentityToRef

  • IdentityToRef(result: Matrix): void
  • Creates a new identity matrix and stores the result in a given matrix

    Parameters

    • result: Matrix

      defines the target matrix

    Returns void

Static InvertSearch playground for Invert

  • Creates a new matrix as the invert of a given matrix

    Parameters

    Returns Matrix

    the new matrix

Static LerpSearch playground for Lerp

  • Returns a new Matrix whose values are the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".

    Parameters

    Returns Matrix

    the new matrix

Static LerpToRefSearch playground for LerpToRef

  • Set the given matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue".

    Parameters

    Returns void

Static LookAtLHSearch playground for LookAtLH

  • Gets a new rotation matrix used to rotate an entity so as it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up" This function works in left handed mode

    Parameters

    Returns Matrix

    the new matrix

Static LookAtLHToRefSearch playground for LookAtLHToRef

  • Sets the given "result" Matrix to a rotation matrix used to rotate an entity so that it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up". This function works in left handed mode

    Parameters

    Returns void

Static LookAtRHSearch playground for LookAtRH

  • Gets a new rotation matrix used to rotate an entity so as it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up" This function works in right handed mode

    Parameters

    Returns Matrix

    the new matrix

Static LookAtRHToRefSearch playground for LookAtRHToRef

  • Sets the given "result" Matrix to a rotation matrix used to rotate an entity so that it looks at the target vector3, from the eye vector3 position, the up vector3 being oriented like "up". This function works in right handed mode

    Parameters

    Returns void

Static LookDirectionLHSearch playground for LookDirectionLH

  • Gets a new rotation matrix used to rotate an entity so as it looks in the direction specified by forward from the eye position, the up direction being oriented like "up". This function works in left handed mode

    Parameters

    • forward: DeepImmutable<Vector3>

      defines the forward direction - Must be normalized and orthogonal to up.

    • up: DeepImmutable<Vector3>

      defines the up vector for the entity - Must be normalized and orthogonal to forward.

    Returns Matrix

    the new matrix

Static LookDirectionLHToRefSearch playground for LookDirectionLHToRef

  • Sets the given "result" Matrix to a rotation matrix used to rotate an entity so that it looks in the direction of forward, the up direction being oriented like "up". This function works in left handed mode

    Parameters

    • forward: DeepImmutable<Vector3>

      defines the forward direction - Must be normalized and orthogonal to up.

    • up: DeepImmutable<Vector3>

      defines the up vector for the entity - Must be normalized and orthogonal to forward.

    • result: Matrix

      defines the target matrix

    Returns void

Static LookDirectionRHSearch playground for LookDirectionRH

  • Gets a new rotation matrix used to rotate an entity so as it looks in the direction specified by forward from the eye position, the up Vector3 being oriented like "up". This function works in right handed mode

    Parameters

    • forward: DeepImmutable<Vector3>

      defines the forward direction - Must be normalized and orthogonal to up.

    • up: DeepImmutable<Vector3>

      defines the up vector for the entity - Must be normalized and orthogonal to forward.

    Returns Matrix

    the new matrix

Static LookDirectionRHToRefSearch playground for LookDirectionRHToRef

  • Sets the given "result" Matrix to a rotation matrix used to rotate an entity so that it looks in the direction of forward, the up vector3 being oriented like "up". This function works in right handed mode

    Parameters

    • forward: DeepImmutable<Vector3>

      defines the forward direction - Must be normalized and orthogonal to up.

    • up: DeepImmutable<Vector3>

      defines the up vector for the entity - Must be normalized and orthogonal to forward.

    • result: Matrix

      defines the target matrix

    Returns void

Static OrthoLHSearch playground for OrthoLH

  • OrthoLH(width: number, height: number, znear: number, zfar: number, halfZRange?: boolean): Matrix
  • Create a left-handed orthographic projection matrix

    Parameters

    • width: number

      defines the viewport width

    • height: number

      defines the viewport height

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    Returns Matrix

    a new matrix as a left-handed orthographic projection matrix

Static OrthoLHToRefSearch playground for OrthoLHToRef

  • OrthoLHToRef(width: number, height: number, znear: number, zfar: number, result: Matrix, halfZRange?: boolean): void
  • Store a left-handed orthographic projection to a given matrix

    Parameters

    • width: number

      defines the viewport width

    • height: number

      defines the viewport height

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • result: Matrix

      defines the target matrix

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    Returns void

Static OrthoOffCenterLHSearch playground for OrthoOffCenterLH

  • OrthoOffCenterLH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, halfZRange?: boolean): Matrix
  • Create a left-handed orthographic projection matrix

    Parameters

    • left: number

      defines the viewport left coordinate

    • right: number

      defines the viewport right coordinate

    • bottom: number

      defines the viewport bottom coordinate

    • top: number

      defines the viewport top coordinate

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    Returns Matrix

    a new matrix as a left-handed orthographic projection matrix

Static OrthoOffCenterLHToRefSearch playground for OrthoOffCenterLHToRef

  • OrthoOffCenterLHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: Matrix, halfZRange?: boolean): void
  • Stores a left-handed orthographic projection into a given matrix

    Parameters

    • left: number

      defines the viewport left coordinate

    • right: number

      defines the viewport right coordinate

    • bottom: number

      defines the viewport bottom coordinate

    • top: number

      defines the viewport top coordinate

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • result: Matrix

      defines the target matrix

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    Returns void

Static OrthoOffCenterRHSearch playground for OrthoOffCenterRH

  • OrthoOffCenterRH(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, halfZRange?: boolean): Matrix
  • Creates a right-handed orthographic projection matrix

    Parameters

    • left: number

      defines the viewport left coordinate

    • right: number

      defines the viewport right coordinate

    • bottom: number

      defines the viewport bottom coordinate

    • top: number

      defines the viewport top coordinate

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    Returns Matrix

    a new matrix as a right-handed orthographic projection matrix

Static OrthoOffCenterRHToRefSearch playground for OrthoOffCenterRHToRef

  • OrthoOffCenterRHToRef(left: number, right: number, bottom: number, top: number, znear: number, zfar: number, result: Matrix, halfZRange?: boolean): void
  • Stores a right-handed orthographic projection into a given matrix

    Parameters

    • left: number

      defines the viewport left coordinate

    • right: number

      defines the viewport right coordinate

    • bottom: number

      defines the viewport bottom coordinate

    • top: number

      defines the viewport top coordinate

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • result: Matrix

      defines the target matrix

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    Returns void

Static PerspectiveFovLHSearch playground for PerspectiveFovLH

  • PerspectiveFovLH(fov: number, aspect: number, znear: number, zfar: number, halfZRange?: boolean, projectionPlaneTilt?: number): Matrix
  • Creates a left-handed perspective projection matrix

    Parameters

    • fov: number

      defines the horizontal field of view

    • aspect: number

      defines the aspect ratio

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    • Optional projectionPlaneTilt: number

      optional tilt angle of the projection plane around the X axis (horizontal)

    Returns Matrix

    a new matrix as a left-handed perspective projection matrix

Static PerspectiveFovLHToRefSearch playground for PerspectiveFovLHToRef

  • PerspectiveFovLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): void
  • Stores a left-handed perspective projection into a given matrix

    Parameters

    • fov: number

      defines the horizontal field of view

    • aspect: number

      defines the aspect ratio

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • result: Matrix

      defines the target matrix

    • Optional isVerticalFovFixed: boolean

      defines it the fov is vertically fixed (default) or horizontally

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    • Optional projectionPlaneTilt: number

      optional tilt angle of the projection plane around the X axis (horizontal)

    Returns void

Static PerspectiveFovRHSearch playground for PerspectiveFovRH

  • PerspectiveFovRH(fov: number, aspect: number, znear: number, zfar: number, halfZRange?: boolean, projectionPlaneTilt?: number): Matrix
  • Creates a right-handed perspective projection matrix

    Parameters

    • fov: number

      defines the horizontal field of view

    • aspect: number

      defines the aspect ratio

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    • Optional projectionPlaneTilt: number

      optional tilt angle of the projection plane around the X axis (horizontal)

    Returns Matrix

    a new matrix as a right-handed perspective projection matrix

Static PerspectiveFovRHToRefSearch playground for PerspectiveFovRHToRef

  • PerspectiveFovRHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): void
  • Stores a right-handed perspective projection into a given matrix

    Parameters

    • fov: number

      defines the horizontal field of view

    • aspect: number

      defines the aspect ratio

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • result: Matrix

      defines the target matrix

    • Optional isVerticalFovFixed: boolean

      defines it the fov is vertically fixed (default) or horizontally

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    • Optional projectionPlaneTilt: number

      optional tilt angle of the projection plane around the X axis (horizontal)

    Returns void

Static PerspectiveFovReverseLHToRefSearch playground for PerspectiveFovReverseLHToRef

  • PerspectiveFovReverseLHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): void
  • Stores a left-handed perspective projection into a given matrix with depth reversed

    Parameters

    • fov: number

      defines the horizontal field of view

    • aspect: number

      defines the aspect ratio

    • znear: number

      defines the near clip plane

    • zfar: number

      not used as infinity is used as far clip

    • result: Matrix

      defines the target matrix

    • Optional isVerticalFovFixed: boolean

      defines it the fov is vertically fixed (default) or horizontally

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    • Optional projectionPlaneTilt: number

      optional tilt angle of the projection plane around the X axis (horizontal)

    Returns void

Static PerspectiveFovReverseRHToRefSearch playground for PerspectiveFovReverseRHToRef

  • PerspectiveFovReverseRHToRef(fov: number, aspect: number, znear: number, zfar: number, result: Matrix, isVerticalFovFixed?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): void
  • Stores a right-handed perspective projection into a given matrix

    Parameters

    • fov: number

      defines the horizontal field of view

    • aspect: number

      defines the aspect ratio

    • znear: number

      defines the near clip plane

    • zfar: number

      not used as infinity is used as far clip

    • result: Matrix

      defines the target matrix

    • Optional isVerticalFovFixed: boolean

      defines it the fov is vertically fixed (default) or horizontally

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    • Optional projectionPlaneTilt: number

      optional tilt angle of the projection plane around the X axis (horizontal)

    Returns void

Static PerspectiveFovWebVRToRefSearch playground for PerspectiveFovWebVRToRef

  • PerspectiveFovWebVRToRef(fov: { downDegrees: number; leftDegrees: number; rightDegrees: number; upDegrees: number }, znear: number, zfar: number, result: Matrix, rightHanded?: boolean, halfZRange?: boolean, projectionPlaneTilt?: number): void
  • Stores a perspective projection for WebVR info a given matrix

    Parameters

    • fov: { downDegrees: number; leftDegrees: number; rightDegrees: number; upDegrees: number }

      defines the field of view

      • downDegrees: number
      • leftDegrees: number
      • rightDegrees: number
      • upDegrees: number
    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • result: Matrix

      defines the target matrix

    • Optional rightHanded: boolean

      defines if the matrix must be in right-handed mode (false by default)

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    • Optional projectionPlaneTilt: number

      optional tilt angle of the projection plane around the X axis (horizontal)

    Returns void

Static PerspectiveLHSearch playground for PerspectiveLH

  • PerspectiveLH(width: number, height: number, znear: number, zfar: number, halfZRange?: boolean, projectionPlaneTilt?: number): Matrix
  • Creates a left-handed perspective projection matrix

    Parameters

    • width: number

      defines the viewport width

    • height: number

      defines the viewport height

    • znear: number

      defines the near clip plane

    • zfar: number

      defines the far clip plane

    • Optional halfZRange: boolean

      true to generate NDC coordinates between 0 and 1 instead of -1 and 1 (default: false)

    • Optional projectionPlaneTilt: number

      optional tilt angle of the projection plane around the X axis (horizontal)

    Returns Matrix

    a new matrix as a left-handed perspective projection matrix

Static ReflectionSearch playground for Reflection

  • Computes a reflection matrix from a plane

    Parameters

    Returns Matrix

    a new matrix

Static ReflectionToRefSearch playground for ReflectionToRef

  • Computes a reflection matrix from a plane

    Parameters

    • plane: DeepImmutable<IPlaneLike>

      defines the reflection plane

    • result: Matrix

      defines the target matrix

    Returns void

Static RotationAlignToRefSearch playground for RotationAlignToRef

Static RotationAxisSearch playground for RotationAxis

  • Creates a new rotation matrix for "angle" radians around the given axis

    Parameters

    • axis: DeepImmutable<Vector3>

      defines the axis to use

    • angle: number

      defines the angle (in radians) to use

    Returns Matrix

    the new matrix

Static RotationAxisToRefSearch playground for RotationAxisToRef

  • Creates a new rotation matrix for "angle" radians around the given axis and stores it in a given matrix

    Parameters

    • axis: DeepImmutable<Vector3>

      defines the axis to use

    • angle: number

      defines the angle (in radians) to use

    • result: Matrix

      defines the target matrix

    Returns void

Static RotationXSearch playground for RotationX

  • RotationX(angle: number): Matrix
  • Creates a new rotation matrix for "angle" radians around the X axis

    Parameters

    • angle: number

      defines the angle (in radians) to use

    Returns Matrix

    the new matrix

Static RotationXToRefSearch playground for RotationXToRef

  • RotationXToRef(angle: number, result: Matrix): void
  • Creates a new rotation matrix for "angle" radians around the X axis and stores it in a given matrix

    Parameters

    • angle: number

      defines the angle (in radians) to use

    • result: Matrix

      defines the target matrix

    Returns void

Static RotationYSearch playground for RotationY

  • RotationY(angle: number): Matrix
  • Creates a new rotation matrix for "angle" radians around the Y axis

    Parameters

    • angle: number

      defines the angle (in radians) to use

    Returns Matrix

    the new matrix

Static RotationYToRefSearch playground for RotationYToRef

  • RotationYToRef(angle: number, result: Matrix): void
  • Creates a new rotation matrix for "angle" radians around the Y axis and stores it in a given matrix

    Parameters

    • angle: number

      defines the angle (in radians) to use

    • result: Matrix

      defines the target matrix

    Returns void

Static RotationYawPitchRollSearch playground for RotationYawPitchRoll

  • RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Matrix
  • Creates a rotation matrix

    Parameters

    • yaw: number

      defines the yaw angle in radians (Y axis)

    • pitch: number

      defines the pitch angle in radians (X axis)

    • roll: number

      defines the roll angle in radians (Z axis)

    Returns Matrix

    the new rotation matrix

Static RotationYawPitchRollToRefSearch playground for RotationYawPitchRollToRef

  • RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Matrix): void
  • Creates a rotation matrix and stores it in a given matrix

    Parameters

    • yaw: number

      defines the yaw angle in radians (Y axis)

    • pitch: number

      defines the pitch angle in radians (X axis)

    • roll: number

      defines the roll angle in radians (Z axis)

    • result: Matrix

      defines the target matrix

    Returns void

Static RotationZSearch playground for RotationZ

  • RotationZ(angle: number): Matrix
  • Creates a new rotation matrix for "angle" radians around the Z axis

    Parameters

    • angle: number

      defines the angle (in radians) to use

    Returns Matrix

    the new matrix

Static RotationZToRefSearch playground for RotationZToRef

  • RotationZToRef(angle: number, result: Matrix): void
  • Creates a new rotation matrix for "angle" radians around the Z axis and stores it in a given matrix

    Parameters

    • angle: number

      defines the angle (in radians) to use

    • result: Matrix

      defines the target matrix

    Returns void

Static ScalingSearch playground for Scaling

  • Scaling(x: number, y: number, z: number): Matrix
  • Creates a scaling matrix

    Parameters

    • x: number

      defines the scale factor on X axis

    • y: number

      defines the scale factor on Y axis

    • z: number

      defines the scale factor on Z axis

    Returns Matrix

    the new matrix

Static ScalingToRefSearch playground for ScalingToRef

  • ScalingToRef(x: number, y: number, z: number, result: Matrix): void
  • Creates a scaling matrix and stores it in a given matrix

    Parameters

    • x: number

      defines the scale factor on X axis

    • y: number

      defines the scale factor on Y axis

    • z: number

      defines the scale factor on Z axis

    • result: Matrix

      defines the target matrix

    Returns void

Static TranslationSearch playground for Translation

  • Translation(x: number, y: number, z: number): Matrix
  • Creates a translation matrix

    Parameters

    • x: number

      defines the translation on X axis

    • y: number

      defines the translation on Y axis

    • z: number

      defines the translationon Z axis

    Returns Matrix

    the new matrix

Static TranslationToRefSearch playground for TranslationToRef

  • TranslationToRef(x: number, y: number, z: number, result: Matrix): void
  • Creates a translation matrix and stores it in a given matrix

    Parameters

    • x: number

      defines the translation on X axis

    • y: number

      defines the translation on Y axis

    • z: number

      defines the translationon Z axis

    • result: Matrix

      defines the target matrix

    Returns void

Static TransposeSearch playground for Transpose

  • Compute the transpose of a given matrix

    Parameters

    Returns Matrix

    the new matrix

Static TransposeToRefSearch playground for TransposeToRef

  • Compute the transpose of a matrix and store it in a target matrix

    Parameters

    Returns void

Static ZeroSearch playground for Zero

  • Creates a new zero matrix

    Returns Matrix

    a new zero matrix

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method