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