Pool:quat

Allocates a new quat from the Pool and returns it.

q = Pool:quat(angle, ax, ay, az, raw)

Arguments

NameTypeDefaultDescription
angle0The angle to use for the rotation, in radians.
axnumber0The x component of the axis of rotation.
aynumber0The y component of the axis of rotation.
aznumber0The z component of the axis of rotation.
rawbooleanfalseWhether the components should be interpreted as raw (x, y, z, w) components.

Returns

NameTypeDescription
qquatThe new quaternion.

q = Pool:quat(angle, axis)

Arguments

NameTypeDefaultDescription
angle0The angle to use for the rotation, in radians.
axisvec3The axis of rotation (does not need to be normalized).

Returns

NameTypeDescription
qquatThe new quaternion.

q = Pool:quat(r)

Arguments

NameTypeDescription
rquatAn existing quaternion to copy the values from.

Returns

NameTypeDescription
qquatThe new quaternion.

Creates a quaternion from a direction vector.

q = Pool:quat(v)

Arguments

NameTypeDescription
vvec3A normalized direction vector.

Returns

NameTypeDescription
qquatThe new quaternion.

Creates a quaternion representing the rotation between two vectors.

q = Pool:quat(v, u)

Arguments

NameTypeDescription
vvec3A normalized direction vector.
uvec3Another normalized direction vector.

Returns

NameTypeDescription
qquatThe new quaternion.

q = Pool:quat(m)

Arguments

NameTypeDescription
mmat4A matrix to use the rotation from.

Returns

NameTypeDescription
qquatThe new quaternion.

See also