Skip to content

CF_Quat

Category: math
GitHub: cute_math3d.h


A quaternion, representing a rotation in 3d.

Struct Members Description
float x The x component of the vector part.
float y The y component of the vector part.
float z The z component of the vector part.
float w The scalar part.

Remarks

Construct one component-wise with cf_quat(x, y, z, w), or from an axis and angle with cf_quat_from_axis_angle.

Stored as the vector part (x, y, z) plus the scalar part w. Quaternions passed to cf_quat_to_m4 or used to rotate a vector are assumed to be unit length; normalize with cf_quat_norm after accumulating many multiplications.

cf_quat_slerp
cf_quat
cf_quat_identity
cf_quat_from_axis_angle
cf_quat_to_m4