quat:__mul

Multiplies this quaternion by another value. If the value is a quaternion, the rotations in the two quaternions are applied sequentially and a new quaternion is returned with the result. If the value is a vector, then a new rotated vector is returned.

s = quat:__mul(q, r)

Arguments

NameTypeDescription
qquatA quaternion.
rquatA quaternion to combine with the original.

Returns

NameTypeDescription
squatThe combined quaternion.

u = quat:__mul(q, v)

Arguments

NameTypeDescription
qquatA quaternion.
vvec3A vector to rotate.

Returns

NameTypeDescription
uvec3The rotated vector.

See also