Mat4:set

Edit

Sets the components of the matrix from separate position, rotation, and scale arguments or an existing matrix.









Resets the matrix to the identity matrix, without any translation, rotation, or scale.

Arguments

None

Returns

NameTypeDescription
mMat4 The input matrix.

Copies the values from an existing matrix.

Arguments

NameTypeDescription
nMat4 An existing matrix to copy the values from.

Returns

NameTypeDescription
mMat4 The input matrix.

Sets the position, scale, and rotation of the matrix using numbers.

Arguments

NameTypeDescription
xnumber The x component of the translation.
ynumber The y component of the translation.
znumber The z component of the translation.
sxnumber The x component of the scale.
synumber The y component of the scale.
sznumber The z component of the scale.
anglenumber The angle of the rotation, in radians.
axnumber The x component of the axis of rotation.
aynumber The y component of the axis of rotation.
aznumber The z component of the axis of rotation.

Returns

NameTypeDescription
mMat4 The input matrix.

Sets the pose (position and orientation) of the matrix using numbers. The scale is set to 1 on all axes.

Arguments

NameTypeDescription
xnumber The x component of the translation.
ynumber The y component of the translation.
znumber The z component of the translation.
anglenumber The angle of the rotation, in radians.
axnumber The x component of the axis of rotation.
aynumber The y component of the axis of rotation.
aznumber The z component of the axis of rotation.

Returns

NameTypeDescription
mMat4 The input matrix.

Arguments

NameTypeDescription
positionVec3 The translation of the matrix.
scaleVec3 The scale of the matrix.
rotationQuat The rotation of the matrix.

Returns

NameTypeDescription
mMat4 The input matrix.

Arguments

NameTypeDescription
positionVec3 The translation of the matrix.
rotationQuat The rotation of the matrix.

Returns

NameTypeDescription
mMat4 The input matrix.

Sets the raw components of the matrix using 16 numbers in column-major order.

Arguments

NameTypeDescription
...number The raw values of the matrix, in column-major order.

Returns

NameTypeDescription
mMat4 The input matrix.

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

Arguments

NameTypeDescription
dnumber A number to use for the diagonal elements.

Returns

NameTypeDescription
mMat4 The input matrix.

See also