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

NameTypeDescription
nMat4The matrix.

Returns

NameTypeDescription
mMat4The original matrix, containing the result.

v3 = Mat4:mul(v3)

Arguments

NameTypeDescription
v3Vec3A 3D vector, treated as a point.

Returns

NameTypeDescription
v3Vec3The transformed vector.

v4 = Mat4:mul(v4)

Arguments

NameTypeDescription
v4Vec4A 4D vector.

Returns

NameTypeDescription
v4Vec4The 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