#include <Karto.h>
Public Member Functions | |
void | FromEulerAngles (kt_double yaw, kt_double pitch, kt_double roll) |
kt_double | GetW () const |
kt_double | GetX () const |
kt_double | GetY () const |
kt_double | GetZ () const |
kt_bool | operator!= (const Quaternion &rOther) const |
Quaternion & | operator= (const Quaternion &rQuaternion) |
kt_bool | operator== (const Quaternion &rOther) const |
Quaternion () | |
Quaternion (const Quaternion &rQuaternion) | |
Quaternion (kt_double x, kt_double y, kt_double z, kt_double w) | |
void | SetW (kt_double w) |
void | SetX (kt_double x) |
void | SetY (kt_double y) |
void | SetZ (kt_double z) |
void | ToEulerAngles (kt_double &rYaw, kt_double &rPitch, kt_double &rRoll) const |
Private Attributes | |
kt_double | m_Values [4] |
Friends | |
std::ostream & | operator<< (std::ostream &rStream, const Quaternion &rQuaternion) |
Defines an orientation as a quaternion rotation using the positive Z axis as the zero reference.
Q = w + ix + jy + kz
w = c_1 * c_2 * c_3 - s_1 * s_2 * s_3
x = s_1 * s_2 * c_3 + c_1 * c_2 * s_3
y = s_1 * c_2 * c_3 + c_1 * s_2 * s_3
z = c_1 * s_2 * c_3 - s_1 * c_2 * s_3
where
c_1 = cos(theta/2)
c_2 = cos(phi/2)
c_3 = cos(psi/2)
s_1 = sin(theta/2)
s_2 = sin(phi/2)
s_3 = sin(psi/2)
and
theta is the angle of rotation about the Y axis measured from the Z axis.
phi is the angle of rotation about the Z axis measured from the X axis.
psi is the angle of rotation about the X axis measured from the Y axis.
(All angles are right-handed.)
|
inline |
|
inline |
Set x,y,z,w values of the quaternion based on Euler angles. Source: http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm
yaw | |
pitch | |
roll |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Converts this quaternion into Euler angles Source: http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm
rYaw | |
rPitch | |
rRoll |
|
friend |