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

NameTypeDescription
mMat4The input matrix.

Copies the values from an existing matrix.

m = Mat4:set(n)

Arguments

NameTypeDescription
nmat4An existing matrix to copy the values from.

Returns

NameTypeDescription
mMat4The input matrix.

m = Mat4:set(position, scale, rotation)

Arguments

NameTypeDefaultDescription
positionVec30, 0, 0The translation of the matrix.
scaleVec31, 1, 1The scale of the matrix.
rotationQuat0, 0, 0, 1The rotation of the matrix.

Returns

NameTypeDescription
mMat4The input matrix.

m = Mat4:set(...)

Arguments

NameTypeDescription
...number16 numbers to use as the raw values of the matrix (column-major).

Returns

NameTypeDescription
mMat4The input matrix.

Sets the diagonal values to a number and everything else to 0.

m = Mat4:set(d)

Arguments

NameTypeDescription
dnumberA number to use for the diagonal elements.

Returns

NameTypeDescription
mMat4The input matrix.

See also