Constructor
new Matrix3()
Create a 3x3 matrix.
Methods
clone() → {t3d.Matrix3}
Creates a new Matrix3 and with identical elements to this one.
Returns:
- Type:
- t3d.
Matrix3
copy(m) → {t3d.Matrix3}
Copies the elements of matrix m into this matrix.
Parameters:
Name | Type | Description |
---|---|---|
m | t3d. |
Returns:
- Type:
- t3d.
Matrix3
fromArray(array, offsetopt) → {t3d.Matrix3}
Sets the elements of this matrix based on an array in column-major format.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
array | Array.<Number> | |||
offset | Number | <optional> | 0 |
Returns:
- Type:
- t3d.
Matrix3
getInverse() → {t3d.Matrix3}
Take the inverse of the matrix
Returns:
- Type:
- t3d.
Matrix3
identity() → {t3d.Matrix3}
Resets this matrix to the 3x3 identity matrix
Returns:
- Type:
- t3d.
Matrix3
inverse() → {t3d.Matrix3}
Take the inverse of this matrix
Returns:
- Type:
- t3d.
Matrix3
isIdentity() → {Boolean}
Checks if the matrix is an identity matrix.
Returns:
- True if the matrix is an identity matrix, false otherwise.
- Type:
- Boolean
multiply(m) → {t3d.Matrix3}
Post-multiplies this matrix by m.
Parameters:
Name | Type | Description |
---|---|---|
m | t3d. |
Returns:
- Type:
- t3d.
Matrix3
multiplyMatrices(a, b) → {t3d.Matrix3}
Sets this matrix to a x b.
Parameters:
Name | Type | Description |
---|---|---|
a | t3d. | |
b | t3d. |
Returns:
- Type:
- t3d.
Matrix3
premultiply(m) → {t3d.Matrix3}
Pre-multiplies this matrix by m.
Parameters:
Name | Type | Description |
---|---|---|
m | t3d. |
Returns:
- Type:
- t3d.
Matrix3
set(n11, n12, n13, n21, n22, n23, n31, n32, n33) → {t3d.Matrix3}
Sets the 3x3 matrix values to the given row-major sequence of values.
Parameters:
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. |
Returns:
- Type:
- t3d.
Matrix3
setFromMatrix4(m) → {t3d.Matrix3}
Sets the matri3 planes from the matrix4.
Parameters:
Name | Type | Description |
---|---|---|
m | t3d. |
Returns:
- Type:
- t3d.
Matrix3
setUvTransform(tx, ty, sx, sy, rotation, cx, cy) → {t3d.Matrix3}
Set the transformation matrix of uv coordinates
Parameters:
Name | Type | Description |
---|---|---|
tx | Number | |
ty | Number | |
sx | Number | |
sy | Number | |
rotation | Number | |
cx | Number | |
cy | Number |
Returns:
- Type:
- t3d.
Matrix3
toArray(arrayopt, offsetopt) → {Array.<Number>}
Writes the elements of this matrix to an array in column-major format.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
array | Array.<Number> | <optional> | ||
offset | Number | <optional> | 0 |
Returns:
- Type:
- Array.<Number>
transform(x, y, scaleX, scaleY, rotation, anchorX, anchorY) → {t3d.Matrix3}
Transform 2D
Parameters:
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 |
Returns:
- Type:
- t3d.
Matrix3
transpose() → {t3d.Matrix3}
Transposes this matrix in place.
Returns:
- Type:
- t3d.
Matrix3