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 original 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 original 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, 0The rotation of the matrix.

Returns

NameTypeDescription
mmat4The original matrix.

m = mat4:set(...)

Arguments

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

Returns

NameTypeDescription
mmat4The original matrix.

See also