quaternion.direction

Edit

Returns the direction of a quaternion. It can also be thought of as rotating the forward vector by this quaternion.

direction = quaternion.direction(q)

Arguments

NameTypeDescription
qquaternion The quaternion to get the direction of.

Returns

NameTypeDescription
directionvector The direction this quaternion "faces". It will be normalized.

Example

local dir = quaternion(collider:getOrientation()):direction()

See also