tf2
master
tf2 maintains the relationship between coordinate frames in a tree structure buffered in time, and lets the user transform points, vectors, etc between any two coordinate frames at any desired point in time.
|
The Quaternion implements quaternion to perform linear algebra rotations in combination with Matrix3x3, Vector3 and Transform. More...
#include <Quaternion.h>
Public Member Functions | |
Quaternion () | |
No initialization constructor. More... | |
Quaternion (const tf2Scalar &x, const tf2Scalar &y, const tf2Scalar &z, const tf2Scalar &w) | |
Constructor from scalars. More... | |
Quaternion (const Vector3 &axis, const tf2Scalar &angle) | |
Axis angle Constructor. More... | |
void | setRotation (const Vector3 &axis, const tf2Scalar &angle) |
Set the rotation using axis angle notation. More... | |
void | setEuler (const tf2Scalar &yaw, const tf2Scalar &pitch, const tf2Scalar &roll) |
Set the quaternion using Euler angles. More... | |
void | setRPY (const tf2Scalar &roll, const tf2Scalar &pitch, const tf2Scalar &yaw) |
Set the quaternion using fixed axis RPY. More... | |
TF2SIMD_FORCE_INLINE Quaternion & | operator+= (const Quaternion &q) |
Add two quaternions. More... | |
Quaternion & | operator-= (const Quaternion &q) |
Sutf2ract out a quaternion. More... | |
Quaternion & | operator*= (const tf2Scalar &s) |
Scale this quaternion. More... | |
Quaternion & | operator*= (const Quaternion &q) |
Multiply this quaternion by q on the right. More... | |
tf2Scalar | dot (const Quaternion &q) const |
Return the dot product between this quaternion and another. More... | |
tf2Scalar | length2 () const |
Return the length squared of the quaternion. More... | |
tf2Scalar | length () const |
Return the length of the quaternion. More... | |
Quaternion & | normalize () |
Normalize the quaternion Such that x^2 + y^2 + z^2 +w^2 = 1. More... | |
TF2SIMD_FORCE_INLINE Quaternion | operator* (const tf2Scalar &s) const |
Return a scaled version of this quaternion. More... | |
Quaternion | operator/ (const tf2Scalar &s) const |
Return an inversely scaled versionof this quaternion. More... | |
Quaternion & | operator/= (const tf2Scalar &s) |
Inversely scale this quaternion. More... | |
Quaternion | normalized () const |
Return a normalized version of this quaternion. More... | |
tf2Scalar | angle (const Quaternion &q) const |
Return the half angle between this quaternion and the other. More... | |
tf2Scalar | angleShortestPath (const Quaternion &q) const |
Return the angle between this quaternion and the other along the shortest path. More... | |
tf2Scalar | getAngle () const |
Return the angle [0, 2Pi] of rotation represented by this quaternion. More... | |
tf2Scalar | getAngleShortestPath () const |
Return the angle [0, Pi] of rotation represented by this quaternion along the shortest path. More... | |
Vector3 | getAxis () const |
Return the axis of the rotation represented by this quaternion. More... | |
Quaternion | inverse () const |
Return the inverse of this quaternion. More... | |
TF2SIMD_FORCE_INLINE Quaternion | operator+ (const Quaternion &q2) const |
Return the sum of this quaternion and the other. More... | |
TF2SIMD_FORCE_INLINE Quaternion | operator- (const Quaternion &q2) const |
Return the difference between this quaternion and the other. More... | |
TF2SIMD_FORCE_INLINE Quaternion | operator- () const |
Return the negative of this quaternion This simply negates each element. More... | |
TF2SIMD_FORCE_INLINE Quaternion | farthest (const Quaternion &qd) const |
TF2SIMD_FORCE_INLINE Quaternion | nearest (const Quaternion &qd) const |
Quaternion | slerp (const Quaternion &q, const tf2Scalar &t) const |
Return the quaternion which is the result of Spherical Linear Interpolation between this and the other quaternion. More... | |
const TF2SIMD_FORCE_INLINE tf2Scalar & | getW () const |
Static Public Member Functions | |
static const Quaternion & | getIdentity () |
The Quaternion implements quaternion to perform linear algebra rotations in combination with Matrix3x3, Vector3 and Transform.
|
inline |
No initialization constructor.
|
inline |
Constructor from scalars.
|
inline |
Axis angle Constructor.
axis | The axis which the rotation is around |
angle | The magnitude of the rotation around the angle (Radians) |
|
inline |
Set the rotation using axis angle notation.
axis | The axis around which to rotate |
angle | The magnitude of the rotation in Radians |
|
inline |
Set the quaternion using Euler angles.
yaw | Angle around Y |
pitch | Angle around X |
roll | Angle around Z |
|
inline |
Set the quaternion using fixed axis RPY.
roll | Angle around X |
pitch | Angle around Y |
yaw | Angle around Z |
|
inline |
Add two quaternions.
q | The quaternion to add to this one |
|
inline |
Sutf2ract out a quaternion.
q | The quaternion to sutf2ract from this one |
|
inline |
Scale this quaternion.
s | The scalar to scale by |
|
inline |
Multiply this quaternion by q on the right.
q | The other quaternion Equivilant to this = this * q |
|
inline |
Return the dot product between this quaternion and another.
q | The other quaternion |
|
inline |
Return the length squared of the quaternion.
|
inline |
Return the length of the quaternion.
|
inline |
Normalize the quaternion Such that x^2 + y^2 + z^2 +w^2 = 1.
|
inline |
Return a scaled version of this quaternion.
s | The scale factor |
|
inline |
Return an inversely scaled versionof this quaternion.
s | The inverse scale factor |
|
inline |
Inversely scale this quaternion.
s | The scale factor |
|
inline |
Return a normalized version of this quaternion.
|
inline |
Return the half angle between this quaternion and the other.
q | The other quaternion |
|
inline |
Return the angle between this quaternion and the other along the shortest path.
q | The other quaternion |
|
inline |
Return the angle [0, 2Pi] of rotation represented by this quaternion.
|
inline |
Return the angle [0, Pi] of rotation represented by this quaternion along the shortest path.
|
inline |
Return the axis of the rotation represented by this quaternion.
|
inline |
Return the inverse of this quaternion.
|
inline |
Return the sum of this quaternion and the other.
q2 | The other quaternion |
|
inline |
Return the difference between this quaternion and the other.
q2 | The other quaternion |
|
inline |
Return the negative of this quaternion This simply negates each element.
|
inline |
|
inline |
|
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. |
|
inlinestatic |
|
inline |