Creates a new matrix with the specified elements. If no arguments are specified, an identity matrix is constructed.
Optionalm00: numberOptionalm01: numberOptionalm02: numberOptionalm03: numberOptionalm10: numberOptionalm11: numberOptionalm12: numberOptionalm13: numberOptionalm20: numberOptionalm21: numberOptionalm22: numberOptionalm23: numberOptionalm30: numberOptionalm31: numberOptionalm32: numberOptionalm33: numberDecompose a matrix to translation, rotation and scale components. Matrix must consist only of translation, rotation and uniform scale transformations, otherwise accurate results are not guaranteed. Applying non-uniform scale guarantees results will not be accurate.
An object containing:
translation the translationrotation the rotationscale the scale.Transform a 3D point by this matrix. w component of the vector is assumed to be 1. After transformation all
components are projected back so that w remains 1. If your matrix doesn't contain projection components use
multiplyAffineVector4 as it is faster.
Point transformed by this matrix.
Sets value of the specified element in the matrix using a linear index. Linear index can be calculated using the following formula: idx = row * 4 + column.
Linear index to gsetet the value of.
New value of the element.
Sets the translation part from the matrix.
The translation as Vector3.
StaticisStaticmultiplyStatictoStaticwithStaticwithTRS
The Matrix4 implements a 4x4 matrix that can be used for homogenous transformations of three dimensional vectors and points.
The class follows the 'copy-on-write' pattern, which means that every operation such as Matrix4.multiply returns a copy of the matrix with updated values. It also implies that the values of the matrix cannot be directly modified.
The concept of immutability improves sharing of objects as all types in TypeScript are assigned by identity, instead of by-value (e.g. a copy) as in other programming languages like C.
Note
The matrix storage is "row-major" meaning that elements [0...3] represents the first row. The first column is represented by the elements[0, 4, 8, 12]