quaternion.angleaxis

Edit

Returns a quaternion that rotates angle radians around an axis.

q = quaternion.angleaxis(angle, ax, ay, az)

Arguments

NameTypeDescription
anglenumber The number of radians the quaternion will rotate around the axis.
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
qquaternion The new quaternion. It will be normalized.

Notes

The quaternion library can be called, which is shorthand for quaternion.angleaxis:

quaternion(angle, ax, ay, az) -- same as quaternion.angleaxis(angle, ax, ay, az)

Example

local q = quaternion(lovr.headset.getOrientation())`

See also