Decompose a matrix to rotation and scale components. Matrix must consist only of rotation and uniform scale transformations, otherwise accurate results are not guaranteed. Applying non-uniform scale guarantees results will not be accurate.
An anonymous object with the following members
rotation, the rotation quaternion.scale, the scale factors.Decomposes the matrix into a set of values.
An object containing the following objects:
matQ Columns form orthonormal bases. If your matrix is affine and doesn't use non-uniform scaling this matrix will be the rotation part of the matrix.vecD If the matrix is affine these will be scaling factors of the matrix.vecU If the matrix is affine these will be shear factors of the 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.
Converts an orthonormal matrix to quaternion representation.
Quaternion representing the rotation in this matrix.
StaticfromCreates a rotation matrix from a quaternion rotation.
Quaternion to create the matrix from.
rotation matrix containing the equivalent rotation of the provided quaternion.
StaticisStaticmultiplyStaticwithStaticwithStaticwithCreates a rotation matrix from the provided euler angle (pitch/yaw/roll) rotation.
Euler angles in degrees.
The order in which rotations will be applied. Different rotations can be created depending on the order.
rotation matrix that can rotate an object to the specified angles.
StaticwithStaticwithCreates a rotation matrix from the provided euler angle (pitch/yaw/roll) rotation.
Pitch angle of rotation.
Yaw angle of rotation.
Roll angle of rotation.
The EulerAngleOrder in which rotations will be applied. Different rotations can be created depending on the order.
rotation matrix that can rotate an object to the specified angles.
StaticwithStaticwith
The Matrix3 implements a 3x3 matrix that can be used for non-homogenous transformations of three dimensional vectors and points.
The class follows the 'copy-on-write' pattern, which means that every operation such as Matrix3.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...2] represents the first row. The first column is represented by the elements [0, 3, 6]