Mat4:set
Sets the components of the matrix from separate position, rotation, and scale arguments or an existing matrix.
Resets the matrix to the identity matrix.
m = Mat4:set()
Arguments
None
Returns
Name | Type | Description |
m | Mat4 | The input matrix.
|
Copies the values from an existing matrix.
m = Mat4:set(n)
Arguments
Name | Type | Description |
n | mat4 | An existing matrix to copy the values from.
|
Returns
Name | Type | Description |
m | Mat4 | The input matrix.
|
m = Mat4:set(position, scale, rotation)
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 input matrix.
|
m = Mat4:set(position, rotation)
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 input matrix.
|
m = Mat4:set(...)
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 input matrix.
|
Sets the diagonal values to a number and everything else to 0.
m = Mat4:set(d)
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