lovr.math.quat

Edit

Creates a temporary quaternion. This function takes the same arguments as Quat:set.







Arguments

NameTypeDefaultDescription
anglenumber0 An angle to use for the rotation, in radians.
axnumber0 The x component of the axis of rotation.
aynumber0 The y component of the axis of rotation.
aznumber0 The z component of the axis of rotation.
rawbooleanfalse Whether the components should be interpreted as raw (x, y, z, w) components.

Returns

NameTypeDescription
qQuat The new quaternion.

Arguments

NameTypeDescription
rQuat An existing quaternion to copy the values from.

Returns

NameTypeDescription
qQuat The new quaternion.

Uses the direction of a vector.

Arguments

NameTypeDescription
vVec3 A normalized direction vector.

Returns

NameTypeDescription
qQuat The new quaternion.

Sets the rotation to represent the rotation between two vectors.

Arguments

NameTypeDescription
vVec3 A normalized direction vector.
uVec3 Another normalized direction vector.

Returns

NameTypeDescription
qQuat The new quaternion.

Arguments

NameTypeDescription
mMat4 A matrix to use the rotation from.

Returns

NameTypeDescription
qQuat The new quaternion.

Set the quaternion to the identity (0, 0, 0, 1).

Arguments

None

Returns

NameTypeDescription
qQuat The new quaternion.

See also