Quat:set

Edit

Sets the components of the quaternion. There are lots of different ways to specify the new components, the summary is:







Arguments

NameTypeDefaultDescription
anglenumber0 The angle to use for the rotation, in radians.
axnumber0 The x component of the axis of rotation.
aynumber0 The y component of the axis of rotation.
aznumber0 The z component of the axis of rotation.
rawbooleanfalse Whether the components should be interpreted as raw (x, y, z, w) components.

Returns

NameTypeDescription
selfQuat The modified quaternion.

Arguments

NameTypeDescription
rQuat An existing quaternion to copy the values from.

Returns

NameTypeDescription
selfQuat The modified quaternion.

Sets the values from a direction vector.

Arguments

NameTypeDescription
vVec3 A normalized direction vector.

Returns

NameTypeDescription
selfQuat The modified quaternion.

Sets the values to represent the rotation between two vectors.

Arguments

NameTypeDescription
vVec3 A normalized direction vector.
uVec3 Another normalized direction vector.

Returns

NameTypeDescription
selfQuat The modified quaternion.

Arguments

NameTypeDescription
mMat4 A matrix to use the rotation from.

Returns

NameTypeDescription
selfQuat The modified quaternion.

Reset the quaternion to the identity (0, 0, 0, 1).

Arguments

None

Returns

NameTypeDescription
selfQuat The modified quaternion.

See also