The Quaternion implements quaternion to perform linear algebra rotations in combination with Matrix3x3, Vector3 and Transform. More...
#include <Quaternion.h>
Public Member Functions | |
tfScalar | angle (const Quaternion &q) const |
Return the ***half*** angle between this quaternion and the other. | |
tfScalar | angleShortestPath (const Quaternion &q) const |
Return the angle between this quaternion and the other along the shortest path. | |
TFSIMD_FORCE_INLINE btQuaternion | as_bt () const __attribute__((deprecated)) |
return a btQuaternion | |
TFSIMD_FORCE_INLINE btQuaternion | asBt () const |
tfScalar | dot (const Quaternion &q) const |
Return the dot product between this quaternion and another. | |
TFSIMD_FORCE_INLINE Quaternion | farthest (const Quaternion &qd) const |
tfScalar | getAngle () const |
Return the angle of rotation represented by this quaternion. | |
tfScalar | getAngleShortestPath () const |
Return the angle of rotation represented by this quaternion along the shortest path. | |
Vector3 | getAxis () const |
Return the axis of the rotation represented by this quaternion. | |
TFSIMD_FORCE_INLINE const tfScalar & | getW () const |
Quaternion | inverse () const |
Return the inverse of this quaternion. | |
tfScalar | length () const |
Return the length of the quaternion. | |
tfScalar | length2 () const |
Return the length squared of the quaternion. | |
TFSIMD_FORCE_INLINE Quaternion | nearest (const Quaternion &qd) const |
Quaternion & | normalize () |
Normalize the quaternion Such that x^2 + y^2 + z^2 +w^2 = 1. | |
Quaternion | normalized () const |
Return a normalized version of this quaternion. | |
TFSIMD_FORCE_INLINE Quaternion | operator* (const tfScalar &s) const |
Return a scaled version of this quaternion. | |
Quaternion & | operator*= (const tfScalar &s) |
Scale this quaternion. | |
Quaternion & | operator*= (const Quaternion &q) |
Multiply this quaternion by q on the right. | |
TFSIMD_FORCE_INLINE Quaternion | operator+ (const Quaternion &q2) const |
Return the sum of this quaternion and the other. | |
TFSIMD_FORCE_INLINE Quaternion & | operator+= (const Quaternion &q) |
Add two quaternions. | |
TFSIMD_FORCE_INLINE Quaternion | operator- (const Quaternion &q2) const |
Return the difference between this quaternion and the other. | |
TFSIMD_FORCE_INLINE Quaternion | operator- () const |
Return the negative of this quaternion This simply negates each element. | |
Quaternion & | operator-= (const Quaternion &q) |
Sutfract out a quaternion. | |
Quaternion | operator/ (const tfScalar &s) const |
Return an inversely scaled versionof this quaternion. | |
Quaternion & | operator/= (const tfScalar &s) |
Inversely scale this quaternion. | |
TFSIMD_FORCE_INLINE Quaternion & | operator= (const btQuaternion &q) |
Assignment from btQuaternion. | |
Quaternion () | |
No initialization constructor. | |
TFSIMD_FORCE_INLINE | Quaternion (const btQuaternion &q) |
Constructor from btQuaternion. | |
Quaternion (const tfScalar &x, const tfScalar &y, const tfScalar &z, const tfScalar &w) | |
Constructor from scalars. | |
Quaternion (const Vector3 &axis, const tfScalar &angle) | |
Axis angle Constructor. | |
Quaternion (const tfScalar &yaw, const tfScalar &pitch, const tfScalar &roll) __attribute__((deprecated)) | |
Constructor from Euler angles. | |
void | setEuler (const tfScalar &yaw, const tfScalar &pitch, const tfScalar &roll) |
Set the quaternion using Euler angles. | |
void | setEulerZYX (const tfScalar &yaw, const tfScalar &pitch, const tfScalar &roll) __attribute__((deprecated)) |
Set the quaternion using euler angles. | |
void | setRotation (const Vector3 &axis, const tfScalar &angle) |
Set the rotation using axis angle notation. | |
void | setRPY (const tfScalar &roll, const tfScalar &pitch, const tfScalar &yaw) |
Set the quaternion using fixed axis RPY. | |
Quaternion | slerp (const Quaternion &q, const tfScalar &t) const |
Return the quaternion which is the result of Spherical Linear Interpolation between this and the other quaternion. | |
Static Public Member Functions | |
static const Quaternion & | getIdentity () |
The Quaternion implements quaternion to perform linear algebra rotations in combination with Matrix3x3, Vector3 and Transform.
Definition at line 30 of file Quaternion.h.
tf::Quaternion::Quaternion | ( | ) | [inline] |
No initialization constructor.
Definition at line 33 of file Quaternion.h.
TFSIMD_FORCE_INLINE tf::Quaternion::Quaternion | ( | const btQuaternion & | q | ) | [inline] |
Constructor from btQuaternion.
the | btQuaternion to copy |
Definition at line 38 of file Quaternion.h.
tf::Quaternion::Quaternion | ( | const tfScalar & | x, |
const tfScalar & | y, | ||
const tfScalar & | z, | ||
const tfScalar & | w | ||
) | [inline] |
Constructor from scalars.
Definition at line 46 of file Quaternion.h.
tf::Quaternion::Quaternion | ( | const Vector3 & | axis, |
const tfScalar & | angle | ||
) | [inline] |
Axis angle Constructor.
axis | The axis which the rotation is around |
angle | The magnitude of the rotation around the angle (Radians) |
Definition at line 52 of file Quaternion.h.
tf::Quaternion::Quaternion | ( | const tfScalar & | yaw, |
const tfScalar & | pitch, | ||
const tfScalar & | roll | ||
) | [inline] |
Constructor from Euler angles.
yaw | Angle around Y unless TF_EULER_DEFAULT_ZYX defined then Z |
pitch | Angle around X unless TF_EULER_DEFAULT_ZYX defined then Y |
roll | Angle around Z unless TF_EULER_DEFAULT_ZYX defined then X |
Definition at line 60 of file Quaternion.h.
tfScalar tf::Quaternion::angle | ( | const Quaternion & | q | ) | const [inline] |
Return the ***half*** angle between this quaternion and the other.
q | The other quaternion |
Definition at line 240 of file Quaternion.h.
tfScalar tf::Quaternion::angleShortestPath | ( | const Quaternion & | q | ) | const [inline] |
Return the angle between this quaternion and the other along the shortest path.
q | The other quaternion |
Definition at line 248 of file Quaternion.h.
TFSIMD_FORCE_INLINE btQuaternion tf::Quaternion::as_bt | ( | ) | const [inline] |
return a btQuaternion
Definition at line 147 of file Quaternion.h.
TFSIMD_FORCE_INLINE btQuaternion tf::Quaternion::asBt | ( | void | ) | const [inline] |
Definition at line 148 of file Quaternion.h.
tfScalar tf::Quaternion::dot | ( | const Quaternion & | q | ) | const [inline] |
Return the dot product between this quaternion and another.
q | The other quaternion |
Definition at line 184 of file Quaternion.h.
TFSIMD_FORCE_INLINE Quaternion tf::Quaternion::farthest | ( | const Quaternion & | qd | ) | const [inline] |
Definition at line 318 of file Quaternion.h.
tfScalar tf::Quaternion::getAngle | ( | ) | const [inline] |
Return the angle of rotation represented by this quaternion.
Definition at line 258 of file Quaternion.h.
tfScalar tf::Quaternion::getAngleShortestPath | ( | ) | const [inline] |
Return the angle of rotation represented by this quaternion along the shortest path.
Definition at line 265 of file Quaternion.h.
Vector3 tf::Quaternion::getAxis | ( | ) | const [inline] |
Return the axis of the rotation represented by this quaternion.
Definition at line 277 of file Quaternion.h.
static const Quaternion& tf::Quaternion::getIdentity | ( | ) | [inline, static] |
Definition at line 370 of file Quaternion.h.
TFSIMD_FORCE_INLINE const tfScalar& tf::Quaternion::getW | ( | ) | const [inline] |
Definition at line 376 of file Quaternion.h.
Quaternion tf::Quaternion::inverse | ( | ) | const [inline] |
Return the inverse of this quaternion.
Definition at line 287 of file Quaternion.h.
tfScalar tf::Quaternion::length | ( | ) | const [inline] |
Return the length of the quaternion.
Definition at line 196 of file Quaternion.h.
tfScalar tf::Quaternion::length2 | ( | ) | const [inline] |
Return the length squared of the quaternion.
Definition at line 190 of file Quaternion.h.
TFSIMD_FORCE_INLINE Quaternion tf::Quaternion::nearest | ( | const Quaternion & | qd | ) | const [inline] |
Definition at line 329 of file Quaternion.h.
Quaternion& tf::Quaternion::normalize | ( | ) | [inline] |
Normalize the quaternion Such that x^2 + y^2 + z^2 +w^2 = 1.
Definition at line 203 of file Quaternion.h.
Quaternion tf::Quaternion::normalized | ( | ) | const [inline] |
Return a normalized version of this quaternion.
Definition at line 234 of file Quaternion.h.
TFSIMD_FORCE_INLINE Quaternion tf::Quaternion::operator* | ( | const tfScalar & | s | ) | const [inline] |
Return a scaled version of this quaternion.
s | The scale factor |
Definition at line 211 of file Quaternion.h.
Quaternion& tf::Quaternion::operator*= | ( | const tfScalar & | s | ) | [inline] |
Scale this quaternion.
s | The scalar to scale by |
Definition at line 165 of file Quaternion.h.
Quaternion& tf::Quaternion::operator*= | ( | const Quaternion & | q | ) | [inline] |
Multiply this quaternion by q on the right.
q | The other quaternion Equivilant to this = this * q |
Definition at line 174 of file Quaternion.h.
TFSIMD_FORCE_INLINE Quaternion tf::Quaternion::operator+ | ( | const Quaternion & | q2 | ) | const [inline] |
Return the sum of this quaternion and the other.
q2 | The other quaternion |
Definition at line 295 of file Quaternion.h.
TFSIMD_FORCE_INLINE Quaternion& tf::Quaternion::operator+= | ( | const Quaternion & | q | ) | [inline] |
Add two quaternions.
q | The quaternion to add to this one |
Definition at line 129 of file Quaternion.h.
TFSIMD_FORCE_INLINE Quaternion tf::Quaternion::operator- | ( | const Quaternion & | q2 | ) | const [inline] |
Return the difference between this quaternion and the other.
q2 | The other quaternion |
Definition at line 304 of file Quaternion.h.
TFSIMD_FORCE_INLINE Quaternion tf::Quaternion::operator- | ( | ) | const [inline] |
Return the negative of this quaternion This simply negates each element.
Definition at line 312 of file Quaternion.h.
Quaternion& tf::Quaternion::operator-= | ( | const Quaternion & | q | ) | [inline] |
Sutfract out a quaternion.
q | The quaternion to sutfract from this one |
Definition at line 157 of file Quaternion.h.
Quaternion tf::Quaternion::operator/ | ( | const tfScalar & | s | ) | const [inline] |
Return an inversely scaled versionof this quaternion.
s | The inverse scale factor |
Definition at line 219 of file Quaternion.h.
Quaternion& tf::Quaternion::operator/= | ( | const tfScalar & | s | ) | [inline] |
Inversely scale this quaternion.
s | The scale factor |
Definition at line 227 of file Quaternion.h.
TFSIMD_FORCE_INLINE Quaternion& tf::Quaternion::operator= | ( | const btQuaternion & | q | ) | [inline] |
Assignment from btQuaternion.
the | btQuaternion to copy |
Definition at line 139 of file Quaternion.h.
void tf::Quaternion::setEuler | ( | const tfScalar & | yaw, |
const tfScalar & | pitch, | ||
const tfScalar & | roll | ||
) | [inline] |
Set the quaternion using Euler angles.
yaw | Angle around Y |
pitch | Angle around X |
roll | Angle around Z |
Definition at line 83 of file Quaternion.h.
void tf::Quaternion::setEulerZYX | ( | const tfScalar & | yaw, |
const tfScalar & | pitch, | ||
const tfScalar & | roll | ||
) | [inline] |
Set the quaternion using euler angles.
yaw | Angle around Z |
pitch | Angle around Y |
roll | Angle around X |
Definition at line 123 of file Quaternion.h.
void tf::Quaternion::setRotation | ( | const Vector3 & | axis, |
const tfScalar & | angle | ||
) | [inline] |
Set the rotation using axis angle notation.
axis | The axis around which to rotate |
angle | The magnitude of the rotation in Radians |
Definition at line 71 of file Quaternion.h.
void tf::Quaternion::setRPY | ( | const tfScalar & | roll, |
const tfScalar & | pitch, | ||
const tfScalar & | yaw | ||
) | [inline] |
Set the quaternion using fixed axis RPY.
roll | Angle around X |
pitch | Angle around Y |
yaw | Angle around Z |
Definition at line 103 of file Quaternion.h.
Quaternion tf::Quaternion::slerp | ( | const Quaternion & | q, |
const tfScalar & | t | ||
) | const [inline] |
Return the quaternion which is the result of Spherical Linear Interpolation between this and the other quaternion.
q | The other quaternion to interpolate with |
t | The ratio between this and q to interpolate. If t = 0 the result is this, if t=1 the result is q. Slerp interpolates assuming constant velocity. |
Definition at line 344 of file Quaternion.h.