Quat

:= []

Rotations as unit quaternions. The record has the same shape as Vocabulary.Quat, so you can pass one where the other goes. Angles are in radians.

from_yaw : F32 -> Quat

A turn of yaw about +y, the way the host turns a Draw, so +z goes to (sin, 0, cos).

from_axis_angle : Vec3, F32 -> Quat

A turn of angle about axis. The axis need not be unit length.

mul : Quat, Quat -> Quat

The two turns as one. The result applies b first, then a.

conjugate : Quat -> Quat

The turn that undoes q. q must be unit length.

between : Vec3, Vec3 -> Quat

The shortest turn that sends a to b. Both must be unit length.

rotate : Vec3, Quat -> Vec3

Turns v by q. q must be unit length.

Quat : { x : F32, y : F32, z : F32, w : F32 }

A rotation as a unit quaternion.