Constructor
new Matrix4()
Create a 4x4 matrix.
Methods
clone() → {t3d.Matrix4}
Creates a new Matrix4 with identical elements to this one.
Returns:
- Type:
- t3d.
Matrix4
copy(m) → {t3d.Matrix4}
Copies the elements of matrix m into this matrix.
Parameters:
Name | Type | Description |
---|---|---|
m | t3d. |
Returns:
- Type:
- t3d.
Matrix4
decompose(position, quaternion, scale) → {t3d.Matrix4}
Decomposes this matrix into it's position, quaternion and scale components.
Parameters:
Name | Type | Description |
---|---|---|
position | t3d. | |
quaternion | t3d. | |
scale | t3d. |
Returns:
- Type:
- t3d.
Matrix4
determinant() → {Number}
Computes and returns the determinant of this matrix.
Returns:
- Type:
- Number
equals(m) → {Boolean}
Return true if this matrix and m are equal.
Parameters:
Name | Type | Description |
---|---|---|
m | t3d. |
Returns:
- Type:
- Boolean
extractRotation() → {t3d.Matrix4}
Extracts the rotation component of the supplied matrix m into this matrix's rotation component.
Returns:
- Type:
- t3d.
Matrix4
fromArray(array, offsetopt) → {t3d.Matrix4}
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.
Matrix4
getInverse() → {t3d.Matrix4}
Take the inverse of the matrix
Returns:
- Type:
- t3d.
Matrix4
getMaxScaleOnAxis() → {Number}
Gets the maximum scale value of the 3 axes.
Returns:
- Type:
- Number
identity() → {t3d.Matrix4}
Resets this matrix to the identity matrix.
Returns:
- Type:
- t3d.
Matrix4
inverse() → {t3d.Matrix4}
Take the inverse of this matrix
Returns:
- Type:
- t3d.
Matrix4
isIdentity() → {Boolean}
Checks if the matrix is an identity matrix.
Returns:
- True if the matrix is an identity matrix, false otherwise.
- Type:
- Boolean
lerpMatrices(m1, m2, ratio) → {t3d.Matrix4}
Linearly interpolates between two matrix4.
Parameters:
Name | Type | Description |
---|---|---|
m1 | t3d. | |
m2 | t3d. | |
ratio | Number |
Returns:
- Type:
- t3d.
Matrix4
lookAtRH(eye, target, update) → {t3d.Matrix4}
Constructs a rotation matrix, looking from eye towards center oriented by the up vector.
Parameters:
Name | Type | Description |
---|---|---|
eye | t3d. | |
target | t3d. | |
update | t3d. |
Returns:
- Type:
- t3d.
Matrix4
makeRotationAxis(axis, angle) → {t3d.Matrix4}
Sets this matrix as rotation transform around axis by theta radians.
Parameters:
Name | Type | Description |
---|---|---|
axis | t3d. | |
angle | Number |
Returns:
- Type:
- t3d.
Matrix4
makeRotationFromQuaternion(q) → {t3d.Matrix4}
Sets the rotation component of this matrix to the rotation specified by q, as outlined here.
Parameters:
Name | Type | Description |
---|---|---|
q | t3d. |
Returns:
- Type:
- t3d.
Matrix4
makeTranslation(x, y, z) → {t3d.Matrix4}
Sets this matrix as a translation transform.
Parameters:
Name | Type | Description |
---|---|---|
x | Number | the amount to translate in the X axis. |
y | Number | the amount to translate in the Y axis. |
z | Number | the amount to translate in the Z axis. |
Returns:
- Type:
- t3d.
Matrix4
multiply(m) → {t3d.Matrix4}
Post-multiplies this matrix by m.
Parameters:
Name | Type | Description |
---|---|---|
m | t3d. |
Returns:
- Type:
- t3d.
Matrix4
multiplyMatrices(a, b) → {t3d.Matrix4}
Sets this matrix to a x b.
Parameters:
Name | Type | Description |
---|---|---|
a | t3d. | |
b | t3d. |
Returns:
- Type:
- t3d.
Matrix4
premultiply(m) → {t3d.Matrix4}
Pre-multiplies this matrix by m.
Parameters:
Name | Type | Description |
---|---|---|
m | t3d. |
Returns:
- Type:
- t3d.
Matrix4
set(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) → {t3d.Matrix4}
Set the elements of this matrix to the supplied row-major values n11, n12, ... n44.
Parameters:
Name | Type | Description |
---|---|---|
n11 | Number | |
n12 | Number | |
n13 | Number | |
n14 | Number | |
n21 | Number | |
n22 | Number | |
n23 | Number | |
n24 | Number | |
n31 | Number | |
n32 | Number | |
n33 | Number | |
n34 | Number | |
n41 | Number | |
n42 | Number | |
n43 | Number | |
n44 | Number |
Returns:
- Type:
- t3d.
Matrix4
setFromMatrix3(m) → {t3d.Matrix4}
Set the upper 3x3 elements of this matrix to the values of the Matrix3 m.
Parameters:
Name | Type | Description |
---|---|---|
m | t3d. |
Returns:
- Type:
- t3d.
Matrix4
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(position, scale, quaternion) → {t3d.Matrix4}
Make transform from position&scale&quaternion(Quaternion).
Parameters:
Name | Type | Description |
---|---|---|
position | t3d. | |
scale | t3d. | |
quaternion | t3d. |
Returns:
- Type:
- t3d.
Matrix4
transpose() → {t3d.Matrix4}
Transposes this matrix.
Returns:
- Type:
- t3d.
Matrix4