Constructor
new Matrix3()
Create a 3x3 matrix.
Methods
clone() → {Matrix3}
Creates a new Matrix3 and with identical elements to this one.
- Type:
- Matrix3
copy(m) → {Matrix3}
Copies the elements of matrix m into this matrix.
Name | Type | Description |
---|---|---|
m | Matrix3 |
- Type:
- Matrix3
equals(matrix) → {boolean}
Return true if this matrix and m are equal.
Name | Type | Description |
---|---|---|
matrix | Matrix3 |
- Type:
- boolean
extractBasis(xAxis, yAxis, zAxis) → {Matrix3}
Extracts the basis vectors from the matrix.
- Type:
- Matrix3
fromArray(array, offsetopt) → {Matrix3}
Sets the elements of this matrix based on an array in column-major format.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
array | Array.<number> | |||
offset | number | <optional> | 0 |
- Type:
- Matrix3
getInverse(matrix) → {Matrix3}
Take the inverse of the matrix
Name | Type | Description |
---|---|---|
matrix | Matrix3 | The matrix to take the inverse of. |
- Type:
- Matrix3
identity() → {Matrix3}
Resets this matrix to the 3x3 identity matrix
- Type:
- Matrix3
inverse() → {Matrix3}
Take the inverse of this matrix
- Type:
- Matrix3
isIdentity() → {boolean}
Checks if the matrix is an identity matrix.
- True if the matrix is an identity matrix, false otherwise.
- Type:
- boolean
multiply(m) → {Matrix3}
Post-multiplies this matrix by m.
Name | Type | Description |
---|---|---|
m | Matrix3 |
- Type:
- Matrix3
multiplyMatrices(a, b) → {Matrix3}
Sets this matrix to a x b.
- Type:
- Matrix3
premultiply(m) → {Matrix3}
Pre-multiplies this matrix by m.
Name | Type | Description |
---|---|---|
m | Matrix3 |
- Type:
- Matrix3
set(n11, n12, n13, n21, n22, n23, n31, n32, n33) → {Matrix3}
Sets the 3x3 matrix values to the given row-major sequence of values.
Name | Type | Description |
---|---|---|
n11 | number | value to put in row 1, col 1. |
n12 | number | value to put in row 1, col 2. |
n13 | number | value to put in row 1, col 3. |
n21 | number | value to put in row 2, col 1. |
n22 | number | value to put in row 2, col 2. |
n23 | number | value to put in row 2, col 3. |
n31 | number | value to put in row 3, col 1. |
n32 | number | value to put in row 3, col 2. |
n33 | number | value to put in row 3, col 3. |
- Type:
- Matrix3
setFromMatrix4(m) → {Matrix3}
Sets the matri3 planes from the matrix4.
Name | Type | Description |
---|---|---|
m | Matrix4 |
- Type:
- Matrix3
setUvTransform(tx, ty, sx, sy, rotation, cx, cy) → {Matrix3}
Set the transformation matrix of uv coordinates
Name | Type | Description |
---|---|---|
tx | number | |
ty | number | |
sx | number | |
sy | number | |
rotation | number | |
cx | number | |
cy | number |
- Type:
- Matrix3
toArray(arrayopt, offsetopt) → {Array.<number>}
Writes the elements of this matrix to an array in column-major format.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
array | Array.<number> | <optional> | ||
offset | number | <optional> | 0 |
- Type:
- Array.<number>
transform(x, y, scaleX, scaleY, rotation, anchorX, anchorY) → {Matrix3}
Transform 2D
Name | Type | Description |
---|---|---|
x | number | position.x |
y | number | position.y |
scaleX | number | scale.x |
scaleY | number | scale.y |
rotation | number | rotation |
anchorX | number | anchor.x |
anchorY | number | anchor.y |
- Type:
- Matrix3
transpose() → {Matrix3}
Transposes this matrix in place.
- Type:
- Matrix3