Quat

Category: Built-In Types

Brief Description

Quaternion.

Member Functions

Quat Quat ( float x, float y, float z, float w )
Quat Quat ( Vector3 axis, float angle )
Quat Quat ( Basis from )
Quat cubic_slerp ( Quat b, Quat pre_a, Quat post_b, float t )
float dot ( Quat b )
Quat inverse ( )
bool is_normalized ( )
float length ( )
float length_squared ( )
Quat normalized ( )
Quat slerp ( Quat b, float t )
Quat slerpni ( Quat b, float t )
Vector3 xform ( Vector3 v )

Member Variables

Description

Quaternion is a 4 dimensional vector that is used to represent a rotation. It mainly exists to perform SLERP (spherical-linear interpolation) between two rotations. Multiplying quaternions also cheaply reproduces rotation sequences. However quaternions need to be often renormalized, or else they suffer from precision issues.

Member Function Description

Returns a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector.

Returns the rotation matrix corresponding to the given quaternion.

Returns the dot product of two quaternions.

Returns the inverse of the quaternion.

  • bool is_normalized ( )

Returns whether the quaternion is normalized or not.

Returns the length of the quaternion.

  • float length_squared ( )

Returns the length of the quaternion, squared.

  • Quat normalized ( )

Returns a copy of the quaternion, normalized to unit length.

Perform a spherical-linear interpolation with another quaternion.