lovr.math.newMat4

Edit

Creates a new 4D matrix. This function takes the same arguments as Mat4:set.







Sets the matrix to the identity matrix.

Arguments

None

Returns

NameTypeDescription
mMat4 The new matrix.

Copies the values from an existing matrix.

Arguments

NameTypeDescription
nMat4 An existing matrix to copy the values from.

Returns

NameTypeDescription
mMat4 The new matrix.

Arguments

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

Returns

NameTypeDescription
mMat4 The new matrix.

Arguments

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

Returns

NameTypeDescription
mMat4 The new matrix.

Arguments

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

Returns

NameTypeDescription
mMat4 The new 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 new matrix.

See also