Creates a new 4D matrix. This function takes the same arguments as Mat4:set
.
Sets the matrix to the identity matrix.
Arguments
None
Returns
Name | Type | Description |
m | Mat4 |
The new 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 new matrix.
|
Arguments
Name | Type | Default | Description |
position | Vec3 | 0, 0, 0 |
The translation of the matrix.
|
scale | Vec3 | 1, 1, 1 |
The scale of the matrix.
|
rotation | Quat | 0, 0, 0, 1 |
The rotation of the matrix.
|
Returns
Name | Type | Description |
m | Mat4 |
The new matrix.
|
Arguments
Name | Type | Default | Description |
position | Vec3 | 0, 0, 0 |
The translation of the matrix.
|
rotation | Quat | 0, 0, 0, 1 |
The rotation of the matrix.
|
Returns
Name | Type | Description |
m | Mat4 |
The new matrix.
|
Arguments
Name | Type | Description |
... | number |
16 numbers to use as the raw values of the matrix (column-major).
|
Returns
Name | Type | Description |
m | Mat4 |
The new 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 new matrix.
|
See also