Mat4:mul
Multiplies this matrix by another value. Multiplying by a matrix combines their two transforms together. Multiplying by a vector applies the transformation from the matrix to the vector and returns the vector.
m = Mat4:mul(n)
Arguments
Name | Type | Description |
n | Mat4 | The matrix.
|
Returns
Name | Type | Description |
m | Mat4 | The original matrix, containing the result.
|
v3 = Mat4:mul(v3)
Arguments
Name | Type | Description |
v3 | Vec3 | A 3D vector, treated as a point.
|
Returns
Name | Type | Description |
v3 | Vec3 | The transformed vector.
|
v4 = Mat4:mul(v4)
Arguments
Name | Type | Description |
v4 | Vec4 | A 4D vector.
|
Returns
Name | Type | Description |
v4 | Vec4 | The transformed vector.
|
Notes
When multiplying by a vec4, the vector is treated as either a point if its w component is 1, or a direction vector if the w is 0 (the matrix translation won't be applied).
See also
Mat4:translate
Mat4:rotate
Mat4:scale
Mat4