Represents a 4x4 matrix.
Signature:
export default class Matrix4 extends Float32Array Extends: Float32Array
All matrix methods result in mutation of the matrix instance. This class extends Float32Array to provide an efficient way to create and manipulate a 4x4 matrix. Various convenience methods are provided for common matrix operations.
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
(constructor)(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) |
Constructs a new instance of the |
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
number |
The determinant of the matrix. | |
|
|
number |
The frobenius norm of the matrix. |
|
Method |
Modifiers |
Description |
|---|---|---|
|
Adds a matrix to the current matrix. | ||
|
Sets the adjugate of the current matrix. | ||
|
Clones the current matrix. | ||
|
Copies a matrix to the current matrix. | ||
|
|
Creates a new | |
|
Checks if the current matrix is approximately equal to another matrix. | ||
|
Checks if the current matrix is exactly equal to another matrix. | ||
|
|
Creates a new | |
|
|
Creates a new | |
|
|
Creates a new | |
|
|
Creates a new | |
|
fromRotationTranslationScaleOrigin(rotation, translation, scale, origin) |
|
Creates a new |
|
|
Creates a new | |
|
|
Creates a new | |
|
|
Creates a new | |
|
|
Creates a new | |
|
|
Creates a new | |
|
Sets the current matrix to a frustrum matrix with the given bounds. | ||
|
Sets the current matrix to the identity matrix. | ||
|
Inverts the current matrix. | ||
|
Sets the current matrix to a look-at matrix with the given eye, center, and up vectors. | ||
|
Multiplies the current matrix by another matrix. | ||
|
Multiplies each element of the current matrix by a scalar value. | ||
|
Sets the current matrix to an orthographic projection matrix with the given bounds. | ||
|
Sets the current matrix to a perspective matrix with the given field of view, aspect ratio, and near and far bounds. | ||
|
Rotates the current matrix by an angle in radians around an axis. | ||
|
Rotates the current matrix by an angle in radians around the x-axis. | ||
|
Rotates the current matrix by an angle in radians around the y-axis. | ||
|
Rotates the current matrix by an angle in radians around the z-axis. | ||
|
Scales the current matrix by a vector. | ||
|
Subtracts a matrix from the current matrix. | ||
|
Sets the current matrix to a matrix that looks at a target. | ||
|
Returns a string representation of the current matrix. | ||
|
Translates the current matrix by a vector. | ||
|
Transposes the current matrix. |