Quat_i.kl¶
Types¶
Quat_i (struct)¶
The Quat_i represents a 3D rotation as a quaternion. Quaternions are used within the Xfo type. A Quat_i can be converted to and from Mat33_i as well as Euler_i types.
/*
** Example: Quat_i
*/
// create several quaternions
Quat_i q0, q1, q2, q3, q4;
q0 = Quat_i(Vec3_i(1.0, 0.0, 0.0), 0.0);
q1.setFromEuler_i(Euler_i(PI, 0.0, 0.0));
q2.setFromDirectionAndUpvector(Vec3_i(1.0, 0.0, 0.0), Vec3_i(0.0, 1.0, 0.0));
q3.setFrom2Vectors(Vec3_i(1.0, 0.0, 0.0), Vec3_i(1.0, 1.0, 0.0));
q4.setFromAxisAndAngle(Vec3_i(0.0, 1.0, 0.0), HALF_PI);