quaternion.unpack

Edit

Returns the components of the quaternion as numbers. Note that these are the raw components, not angle/axis.

x, y, z, w = quaternion.unpack(q)

Arguments

NameTypeDescription
qquaternion The quaternion to unpack.

Returns

NameTypeDescription
xnumber The x component of the quaternion.
ynumber The y component of the quaternion.
znumber The z component of the quaternion.
wnumber The w component of the quaternion.

Example

local x, y, z, w = quaternion.pack(1, 2, 3, 4):unpack()

See also