Template class for quaternions. More...
#include </home/chochlik/devel/oglplus/include/oglplus/math/quaternion.hpp>
Public Member Functions | |
Quaternion (T a, T x, T y, T z) | |
Constructs a quaternion. | |
Quaternion (Vector< T, 3 > axis, Angle< T > angle) | |
Construct a Quaternion from an axis and an angle . | |
Quaternion (T real, const Vector< T, 3 > &imag) | |
Construct q Quaternion from the real and imag parts. | |
T | Real (void) const |
Returns the real scalar part of the quaternion. | |
Vector< T, 3 > | Imag (void) const |
Returns the imaginary vector part of the quaternion. | |
T | Magnitude (void) const |
Returns the magnitude of the quaternion. | |
bool | IsUnit (T eps=T(0)) const |
Returns true if the quaternion has unit Magnitude. More... | |
bool | IsNormal (T eps=T(0)) const |
Synonym for IsUnit. More... | |
bool | IsDegenerate (T eps=T(0)) const |
Returns true if the quaternion has zero Magnitude. | |
Quaternion & | Normalize (void) |
Normalizes this quaternion. More... | |
Friends | |
bool | Equal (const Quaternion &q1, const Quaternion &q2) |
Equality comparison. | |
bool | Close (const Quaternion &q1, const Quaternion &q2, T eps) |
Near-equality comparison. | |
bool | operator== (const Quaternion &q1, const Quaternion &q2) |
Equality comparison. | |
bool | operator!= (const Quaternion &q1, const Quaternion &q2) |
Non-equality comparison. | |
Quaternion | Conjugate (const Quaternion &q1) |
Conjugate quaternion. | |
Quaternion | operator~ (const Quaternion &q1) |
Conjugation. | |
Quaternion | Inverse (const Quaternion &q1) |
Inverse quaternion. | |
Quaternion | Add (const Quaternion &q1, const Quaternion &q2) |
Quaternion addition. | |
Quaternion | operator+ (const Quaternion &q1, const Quaternion &q2) |
Addition operator. | |
Quaternion | Multiply (const Quaternion &q1, const Quaternion &q2) |
Quaternion multiplication. | |
Quaternion | operator* (const Quaternion &q1, const Quaternion &q2) |
Multiplication operator. | |
Quaternion | operator* (const Quaternion &q1, T t) |
Multiplication by scalar operator. | |
Quaternion | operator* (T t, const Quaternion &q1) |
Multiplication by scalar operator. | |
Vector< T, 3 > | Rotate (const Quaternion &q, const Vector< T, 3 > &v) |
Rotate a vector by this quaternion. More... | |
Template class for quaternions.
bool oglplus::Quaternion< T >::IsNormal | ( | T | eps = T(0) | ) | const |
bool oglplus::Quaternion< T >::IsUnit | ( | T | eps = T(0) | ) | const |
Returns true if the quaternion has unit Magnitude.
References oglplus::T.
Referenced by oglplus::Quaternion< T >::IsNormal().
Quaternion& oglplus::Quaternion< T >::Normalize | ( | void | ) |
Normalizes this quaternion.
References oglplus::Quaternion< T >::Magnitude(), and oglplus::T.
|
friend |
Rotate a vector by this quaternion.