Sets the components of the matrix from separate position, rotation, and scale arguments or an existing matrix.
Resets the matrix to the identity matrix, without any translation, rotation, or scale.
Arguments
None
Returns
Name | Type | Description |
m | Mat4 |
The input matrix.
|
Copies the values from an existing matrix.
Arguments
Name | Type | Description |
n | Mat4 |
An existing matrix to copy the values from.
|
Returns
Name | Type | Description |
m | Mat4 |
The input matrix.
|
Sets the position, scale, and rotation of the matrix using numbers.
Arguments
Name | Type | Description |
x | number |
The x component of the translation.
|
y | number |
The y component of the translation.
|
z | number |
The z component of the translation.
|
sx | number |
The x component of the scale.
|
sy | number |
The y component of the scale.
|
sz | number |
The z component of the scale.
|
angle | number |
The angle of the rotation, in radians.
|
ax | number |
The x component of the axis of rotation.
|
ay | number |
The y component of the axis of rotation.
|
az | number |
The z component of the axis of rotation.
|
Returns
Name | Type | Description |
m | Mat4 |
The input matrix.
|
Sets the pose (position and orientation) of the matrix using numbers. The scale is set to 1 on all axes.
Arguments
Name | Type | Description |
x | number |
The x component of the translation.
|
y | number |
The y component of the translation.
|
z | number |
The z component of the translation.
|
angle | number |
The angle of the rotation, in radians.
|
ax | number |
The x component of the axis of rotation.
|
ay | number |
The y component of the axis of rotation.
|
az | number |
The z component of the axis of rotation.
|
Returns
Name | Type | Description |
m | Mat4 |
The input matrix.
|
Arguments
Name | Type | Description |
position | Vec3 |
The translation of the matrix.
|
scale | Vec3 |
The scale of the matrix.
|
rotation | Quat |
The rotation of the matrix.
|
Returns
Name | Type | Description |
m | Mat4 |
The input matrix.
|
Arguments
Name | Type | Description |
position | Vec3 |
The translation of the matrix.
|
rotation | Quat |
The rotation of the matrix.
|
Returns
Name | Type | Description |
m | Mat4 |
The input matrix.
|
Sets the raw components of the matrix using 16 numbers in column-major order.
Arguments
Name | Type | Description |
... | number |
The raw values of the matrix, in column-major order.
|
Returns
Name | Type | Description |
m | Mat4 |
The input matrix.
|
Sets the diagonal values to a number and everything else to 0.
Arguments
Name | Type | Description |
d | number |
A number to use for the diagonal elements.
|
Returns
Name | Type | Description |
m | Mat4 |
The input matrix.
|
See also