Creates a new MutableMatrix33 instance.
The typed array containing the matrix components
Gets the class name for debugging purposes.
The string 'MutableMatrix33'
Gets the matrix as a GLSL mat3 string with float precision.
GLSL mat3 constructor string
Gets the matrix as a GLSL mat3 string with integer values.
GLSL mat3 constructor string with floored values
Indicates whether this matrix is an identity matrix class.
This property should be overridden in derived classes that represent identity matrices to return true.
False for the base AbstractMatrix class
Gets the matrix element at position (0,0).
The value at position (0,0)
Sets the matrix element at position (0,0).
The value to set
Gets the matrix element at position (0,1).
The value at position (0,1)
Sets the matrix element at position (0,1).
The value to set
Gets the matrix element at position (0,2).
The value at position (0,2)
Sets the matrix element at position (0,2).
The value to set
Gets the matrix element at position (1,0).
The value at position (1,0)
Sets the matrix element at position (1,0).
The value to set
Gets the matrix element at position (1,1).
The value at position (1,1)
Sets the matrix element at position (1,1).
The value to set
Gets the matrix element at position (1,2).
The value at position (1,2)
Sets the matrix element at position (1,2).
The value to set
Gets the matrix element at position (2,0).
The value at position (2,0)
Sets the matrix element at position (2,0).
The value to set
Gets the matrix element at position (2,1).
The value at position (2,1)
Sets the matrix element at position (2,1).
The value to set
Gets the matrix element at position (2,2).
The value at position (2,2)
Sets the matrix element at position (2,2).
The value to set
Gets the matrix as a WGSL mat3x3f string with float precision.
WGSL mat3x3f constructor string
Gets the matrix as a WGSL mat3x3i string with integer values.
WGSL mat3x3i constructor string with floored values
StaticcompositionGets the composition type for this matrix.
CompositionType.Mat3
Gets the matrix element at the specified row and column.
The row index (0-2)
The column index (0-2)
The matrix element at the specified position
Creates a copy of this matrix.
A new MutableMatrix33 instance with the same values
Copies components from another matrix (3x3 or 4x4) into this matrix. For 4x4 matrices, only the upper-left 3x3 portion is copied.
This matrix instance for method chaining
Calculates the determinant of this matrix.
The determinant value
Converts the matrix to a flat array in column-major order.
An array containing all 9 matrix elements
Extracts the scale factors from this matrix.
A new Vector3 containing the scale factors for each axis
Extracts the scale factors from this matrix and stores them in an output vector.
The output mutable vector to store the scale factors
The output vector containing the scale factors
Sets this matrix to the identity matrix.
This matrix instance for method chaining
Inverts this matrix in place using the determinant method.
If the matrix is numerically singular, it is set to the identity matrix
instead of being filled with Infinity/NaN.
Use MutableMatrix33.tryInvert when the caller needs to detect the failure.
This matrix instance for method chaining
Checks if this matrix is a dummy matrix (empty data array).
True if the matrix has no data, false otherwise
Checks if this matrix is approximately equal to another matrix.
The matrix to compare with
The tolerance for comparison (default: Number.EPSILON)
True if matrices are approximately equal, false otherwise
Checks if this matrix is strictly equal to another matrix.
The matrix to compare with
True if all elements are exactly equal, false otherwise
Checks if the matrix's internal storage shares the same ArrayBuffer as the provided one.
This method is useful for determining if two matrices share the same underlying memory, which can be important for performance optimizations and avoiding unnecessary data copying.
The ArrayBuffer to compare against
True if the internal storage uses the same ArrayBuffer, false otherwise
Multiplies this matrix by another matrix from the right side (this = this * mat). If the input matrix is an identity matrix, no operation is performed for optimization.
The matrix to multiply with from the right
This matrix instance for method chaining
Multiplies this matrix by another matrix from the left side (this = mat * this). If the input matrix is an identity matrix, no operation is performed for optimization.
The matrix to multiply with from the left
This matrix instance for method chaining
Multiplies this matrix by a scale matrix, applying scaling to the existing transformation. Each column of the matrix is scaled by the corresponding component of the vector.
A vector containing scale factors for X, Y, and Z axes
This matrix instance for method chaining
Multiplies this matrix with a vector.
The vector to multiply
A new vector representing the result of matrix * vector
Multiplies this matrix with a vector and stores the result in an output vector.
The vector to multiply
The output mutable vector to store the result
The output vector containing the result of matrix * vector
Gets the raw Float32Array containing the matrix data.
The underlying Float32Array in column-major order
Sets this matrix to a rotation matrix from a vector containing rotation angles.
A vector containing rotation angles for X, Y, and Z axes in radians
This matrix instance for method chaining
Sets this matrix to a rotation matrix around the X-axis.
The rotation angle in radians
This matrix instance for method chaining
Sets this matrix to a rotation matrix for combined X, Y, and Z axis rotations. Rotations are applied in the order: Z * Y * X (which means X is applied first, then Y, then Z).
Rotation angle around X-axis in radians
Rotation angle around Y-axis in radians
Rotation angle around Z-axis in radians
This matrix instance for method chaining
Sets this matrix to a rotation matrix around the Y-axis.
The rotation angle in radians
This matrix instance for method chaining
Sets this matrix to a rotation matrix around the Z-axis.
The rotation angle in radians
This matrix instance for method chaining
Sets this matrix to a scaling matrix.
A vector containing scale factors for X, Y, and Z axes
This matrix instance for method chaining
Sets a value at the specified row and column position.
The row index (0-2)
The column index (0-2)
The value to set
This matrix instance for method chaining
Sets all matrix components using row-major order parameters.
Element at position (0,0)
Element at position (0,1)
Element at position (0,2)
Element at position (1,0)
Element at position (1,1)
Element at position (1,2)
Element at position (2,0)
Element at position (2,1)
Element at position (2,2)
This matrix instance for method chaining
Converts the matrix to a human-readable string representation.
A formatted string showing the matrix in 3x3 layout
Converts the matrix to a human-readable string with rounded values.
A formatted string showing the matrix with financially rounded values
Attempts to invert this matrix in place.
The matrix is left unchanged when it is numerically singular, which lets callers keep the previous valid value.
True if the inversion succeeded, false if the matrix is singular
Gets the matrix element at the specified index in the internal array.
The index (0-8)
The matrix element at the specified index
Sets this matrix to the zero matrix (all elements set to 0).
This matrix instance for method chaining
Static_Creates a dummy matrix with empty data array. Used for placeholder purposes.
A new Matrix33 with empty Float32Array
Static_Creates a Matrix33 from 9 values in column-major order.
Element at row 0, column 0
Element at row 1, column 0
Element at row 2, column 0
Element at row 0, column 1
Element at row 1, column 1
Element at row 2, column 1
Element at row 0, column 2
Element at row 1, column 2
Element at row 2, column 2
A new Matrix33 instance
Static_Creates a Matrix33 from 9 values in row-major order. Values are stored internally in column-major order for WebGL compatibility.
Element at row 0, column 0
Element at row 0, column 1
Element at row 0, column 2
Element at row 1, column 0
Element at row 1, column 1
Element at row 1, column 2
Element at row 2, column 0
Element at row 2, column 1
Element at row 2, column 2
A new Matrix33 instance
Static_Creates a Matrix33 from an Array9 in column-major order.
The Array9 containing 9 numbers
A new Matrix33 instance
Static_Creates a Matrix33 from an Array9 in row-major order.
The Array9 containing 9 numbers in row-major order
A new Matrix33 instance
Static_Creates a Matrix33 from a regular array in column-major order.
The array containing at least 9 numbers
A new Matrix33 instance
Static_Creates a Matrix33 from a regular array in row-major order.
The array containing at least 9 numbers in row-major order
A new Matrix33 instance
Static_Creates a Matrix33 by copying from another IMatrix33.
The matrix to copy from
A new Matrix33 instance
Static_Creates a Matrix33 from the upper-left 3x3 portion of a Matrix44.
The Matrix44 to extract from
A new Matrix33 instance
Static_Creates a Matrix33 from a quaternion representing rotation.
The quaternion to convert
A new Matrix33 representing the rotation
Static_Creates a Matrix33 by copying from a Float32Array in column-major order.
A new Matrix33 instance
Static_Creates a Matrix33 by copying from a Float32Array in row-major order.
The Float32Array in row-major order
A new Matrix33 instance
Static_Creates a Matrix33 using the provided Float32Array directly (no copy).
A new Matrix33 instance
Static_Creates an identity matrix.
A new identity matrix (optimized IdentityMatrix33 instance)
Static_Creates the inverse of the given matrix.
If the matrix is numerically singular, an identity matrix is returned instead of dividing by zero. Use Matrix33.tryInvert when the caller needs to detect the failure.
The matrix to invert
A new inverted matrix, or the identity matrix if the input is singular
Static_Calculates the inverse of the given matrix and stores the result in the output matrix.
If the matrix is numerically singular, the output matrix is set to the
identity matrix instead of being filled with Infinity/NaN.
Use Matrix33.tryInvertTo when the caller needs to detect the failure.
The matrix to invert
The output mutable matrix to store the result
The output matrix containing the inverted matrix, or the identity matrix if the input is singular
Static_Multiplies two matrices together.
The left matrix
The right matrix
A new matrix representing l_mat * r_mat
Static_Multiplies two matrices and stores the result in an output matrix.
The left matrix
The right matrix
The output mutable matrix to store the result
The output matrix containing l_mat * r_mat
Static_Creates a rotation matrix from a Vector3 containing Euler angles.
Vector3 containing rotation angles (x, y, z) in radians
A new rotation matrix
Static_Creates a rotation matrix around the X-axis.
The rotation angle in radians
A new rotation matrix
Static_Creates a rotation matrix from Euler angles in XYZ order.
Rotation around X-axis in radians
Rotation around Y-axis in radians
Rotation around Z-axis in radians
A new rotation matrix representing the combined rotations
Static_Creates a rotation matrix around the Y-axis.
The rotation angle in radians
A new rotation matrix
Static_Creates a rotation matrix around the Z-axis.
The rotation angle in radians
A new rotation matrix
Static_Creates a scaling matrix.
Vector3 containing scale factors for each axis
A new scaling matrix
Static_Creates the transpose of the given matrix.
The matrix to transpose
A new transposed matrix
Static_Attempts to create the inverse of the given matrix.
Returns null instead of dividing by zero when the matrix is numerically singular (see MathUtil.isSingularDet).
The matrix to invert
A new inverted matrix, or null if the matrix is not invertible
Static_Attempts to calculate the inverse of the given matrix and stores the result in the output matrix. The output matrix is left untouched when the input is numerically singular.
The matrix to invert
The output mutable matrix to store the result
True if the inversion succeeded, false if the matrix is singular
Static_Creates a zero matrix (all elements are 0).
A new Matrix33 with all zero elements
StaticdummyCreates a dummy matrix with an empty array.
StaticfromCreates a matrix from column-major components.
StaticfromCreates a matrix from row-major components.
StaticfromCreates a matrix from a 9-element array in column-major order.
StaticfromCreates a matrix from a 9-element array in row-major order.
StaticfromCreates a matrix from an array in column-major order.
StaticfromCreates a matrix from an array in row-major order.
StaticfromCreates a matrix by copying a Float32Array in column-major order.
StaticfromCreates a matrix by copying a Float32Array in row-major order.
StaticfromStaticfromCreates a matrix from the upper-left 3x3 portion of a 4x4 matrix.
StaticfromCreates a matrix from a quaternion representing a rotation.
StaticfromCreates a matrix that directly uses the given Float32Array.
StaticidentityCreates an identity matrix (optimized IdentityMatrix33 instance).
StaticinvertCreates the inverse of the given matrix (identity when singular).
StaticinvertInverts the given matrix into outMat (identity when singular).
StaticmultiplyStaticmultiplyMultiplies two matrices and stores the result in outMat.
StaticrotateCreates a rotation matrix from a Vector3 containing Euler angles.
StaticrotateStaticrotateCreates a rotation matrix from Euler angles in XYZ order.
StaticrotateStaticrotateStaticscaleStatictransposeStatictryAttempts to invert the given matrix, returning null when it is singular.
StatictryAttempts to invert the given matrix into outMat.
StaticzeroCreates a zero matrix.
A mutable 3x3 matrix class that extends Matrix33 and provides mutating operations. This class stores matrix data in column-major order as a Float32Array. All transformation methods modify the matrix in place and return the same instance for method chaining.
Matrix layout in memory (column-major order):
Which represents the matrix: