Skip to content

cf_quat_to_b3

Category: physics
GitHub: cute_physics.h


Converts a CF_Quat to a b3Quat.

b3Quat cf_quat_to_b3(CF_Quat q) { b3Quat out; out.v.x = q.x; out.v.y = q.y; out.v.z = q.z; out.s = q.w; return out; }

Remarks

The layouts agree -- b3Quat stores the vector part first and calls the scalar s where CF calls it w -- so this is a plain repack.

cf_b3_to_quat
cf_v3_to_b3
cf_m4_to_b3