#include <Geometry.h>
Private Attributes | |
kt_double | m_Values [4] |
Friends | |
KARTO_FORCEINLINE 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.)
Definition at line 1307 of file Geometry.h.
|
inline |
Quaternion with default (x=0, y=0, z=0, w=1) values
Definition at line 1313 of file Geometry.h.
Quaternion using given x, y, z, w values.
x | x |
y | y |
z | z |
w | w |
Definition at line 1328 of file Geometry.h.
|
inline |
Quaternion from given Vector4d
Definition at line 1339 of file Geometry.h.
|
inline |
Copy constructor
Definition at line 1350 of file Geometry.h.
void karto::Quaternion::FromAngleAxis | ( | kt_double | angleInRadians, |
const karto::Vector3d & | rAxis | ||
) |
Computes the equivalent quaternion from the given angle-axis form
Definition at line 118 of file Geometry.cpp.
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 | yaw |
pitch | pitch |
roll | roll |
Definition at line 170 of file Geometry.cpp.
|
inline |
This quaternion as a 4D vector
Definition at line 1435 of file Geometry.h.
|
inline |
Returns the w-value
Definition at line 1417 of file Geometry.h.
|
inline |
Returns the x-value
Definition at line 1363 of file Geometry.h.
|
inline |
Returns the y-value
Definition at line 1381 of file Geometry.h.
|
inline |
Returns the z-value
Definition at line 1399 of file Geometry.h.
|
inline |
Length of this quaternion
Definition at line 1474 of file Geometry.h.
|
inline |
Returns the norm of this quaternion
Definition at line 1483 of file Geometry.h.
|
inline |
Normalize the quaternion
Definition at line 1491 of file Geometry.h.
|
inline |
Inequality operator
Definition at line 1548 of file Geometry.h.
|
inline |
Quaternion multiplication; note that quaternion multiplication is not commutative (a * b != b * a)
Definition at line 1528 of file Geometry.h.
|
inline |
Rotate a vector by this quaternion
rVector | vector |
Definition at line 1558 of file Geometry.h.
|
inline |
Assignment operator
Definition at line 1515 of file Geometry.h.
|
inline |
Equality operator
Definition at line 1540 of file Geometry.h.
|
inline |
|
inline |
|
inline |
|
inline |
void karto::Quaternion::ToAngleAxis | ( | kt_double & | rAngle, |
karto::Vector3d & | rAxis | ||
) | const |
This quaternion in angle-axis form
rAngle | output parameter angle |
rAxis | output parameter axis |
Definition at line 94 of file Geometry.cpp.
void karto::Quaternion::ToEulerAngles | ( | kt_double & | rYaw, |
kt_double & | rPitch, | ||
kt_double & | rRoll | ||
) | const |
Converts this quaternion into Euler angles Source: http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm
rYaw | yaw |
rPitch | pitch |
rRoll | roll |
Definition at line 140 of file Geometry.cpp.
const String karto::Quaternion::ToString | ( | ) | const |
String representation of this quaternion
Definition at line 192 of file Geometry.cpp.
|
friend |
Write this quaternion onto output stream
Definition at line 1576 of file Geometry.h.
|
private |
Definition at line 1583 of file Geometry.h.