Creates a new mutable 3x3 matrix from a Float32Array.
A Float32Array containing 9 elements in column-major order
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
Static
compositionGets the composition type for this matrix.
CompositionType.Mat3
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
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. Logs an error if the determinant is 0 (matrix is not invertible).
This matrix instance for method chaining
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
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
Transposes this matrix in place.
This matrix instance for method chaining
Sets this matrix to the zero matrix (all elements set to 0).
This matrix instance for method chaining
Static
dummyCreates a dummy matrix for testing purposes.
A new MutableMatrix33 instance with default values
Static
fromCreates a new matrix from 9 values specified in column-major order. This matches the internal storage format of WebGL matrices.
Element at position (0,0)
Element at position (1,0)
Element at position (2,0)
Element at position (0,1)
Element at position (1,1)
Element at position (2,1)
Element at position (0,2)
Element at position (1,2)
Element at position (2,2)
A new MutableMatrix33 instance
Static
fromCreates a new matrix from 9 values specified in row-major order. This is more intuitive when writing matrix values as they appear visually.
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)
A new MutableMatrix33 instance
Static
fromCreates a new matrix from a 9-element array in column-major order.
An array containing exactly 9 numbers in column-major order
A new MutableMatrix33 instance
Static
fromCreates a new matrix from a 9-element array in row-major order. The data is converted to column-major order during the creation process.
An array containing exactly 9 numbers in row-major order
A new MutableMatrix33 instance
Static
fromCreates a new matrix from an array in column-major order. Only the first 9 elements are used if the array is larger.
An array containing the matrix data in column-major order
A new MutableMatrix33 instance
Static
fromCreates a new matrix from an array in row-major order. Only the first 9 elements are used if the array is larger. The data is converted to column-major order during the creation process.
An array containing the matrix data in row-major order
A new MutableMatrix33 instance
Static
fromCreates a new matrix by copying data from a Float32Array in column-major order.
A Float32Array containing the matrix data to copy
A new MutableMatrix33 instance with copied data
Static
fromCreates a new matrix by copying data from a Float32Array in row-major order. The data is converted to column-major order during the copy process.
A Float32Array containing the matrix data in row-major order
A new MutableMatrix33 instance with converted data
Static
fromCreates a new matrix by copying from another 3x3 matrix.
The source matrix to copy from
A new MutableMatrix33 instance with copied data
Static
fromCreates a new 3x3 matrix by copying the upper-left 3x3 portion of a 4x4 matrix.
The 4x4 matrix to copy from
A new MutableMatrix33 instance
Static
fromCreates a new rotation matrix from a quaternion. Converts the quaternion representation to its equivalent 3x3 rotation matrix.
The quaternion to convert (should be normalized)
A new MutableMatrix33 instance representing the rotation
Static
fromCreates a new matrix using the provided Float32Array directly (no copy). The array should contain 9 elements in column-major order.
A Float32Array containing the matrix data
A new MutableMatrix33 instance that shares the array reference
Static
identityCreates a new identity matrix.
A new MutableMatrix33 instance representing the identity matrix
Static
invertCreates a new matrix that is the inverse of the input matrix.
The matrix to invert
A new MutableMatrix33 instance representing the inverted matrix
Static
invertCalculates the inverse of the given matrix and stores the result in the output matrix.
The matrix to invert
The output mutable matrix to store the result
The output matrix containing the inverted matrix
Static
multiplyMultiplies two matrices and returns the result as a new matrix.
A new MutableMatrix33 instance representing l_mat * r_mat
Static
multiplyMultiplies 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
rotateCreates a rotation matrix from a vector containing rotation angles.
A vector containing rotation angles for X, Y, and Z axes
A new MutableMatrix33 instance representing the rotation
Static
rotateXCreates a rotation matrix around the X-axis.
The rotation angle in radians
A new MutableMatrix33 instance representing the X-axis rotation
Static
rotateXYZCreates a rotation matrix for combined X, Y, and Z axis rotations applied in that order.
Rotation angle around X-axis in radians
Rotation angle around Y-axis in radians
Rotation angle around Z-axis in radians
A new MutableMatrix33 instance representing the combined rotation
Static
rotateYCreates a rotation matrix around the Y-axis.
The rotation angle in radians
A new MutableMatrix33 instance representing the Y-axis rotation
Static
rotateZCreates a rotation matrix around the Z-axis.
The rotation angle in radians
A new MutableMatrix33 instance representing the Z-axis rotation
Static
scaleCreates a scaling matrix from a vector.
A vector containing scale factors for X, Y, and Z axes
A new MutableMatrix33 instance representing the scaling transformation
Static
transposeCreates a new matrix that is the transpose of the input matrix.
The matrix to transpose
A new MutableMatrix33 instance representing the transposed matrix
Static
zeroCreates a new zero matrix (all elements set to 0).
A new MutableMatrix33 instance with all elements set to 0
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: