4 Component Quaternion. More...
#include <decQuaternion.h>
Public Member Functions | |
Constructors and Destructors | |
| decQuaternion () | |
| Creates a new quaternion initialized to no rotation. | |
| decQuaternion (float nx, float ny, float nz, float nw) | |
| Creates a new quaternion with the given values. | |
| decQuaternion (const decQuaternion &q) | |
| Creates a new quaternion with the values of another quaternion. | |
Management | |
| float | Length () const |
| Retrieves the length of the quaternion. | |
| void | Normalize () |
| Normalizes the quaternion. | |
| decQuaternion | Conjugate () const |
| Retrieves the conjugation of this quaternion. | |
| decQuaternion | Slerp (const decQuaternion &other, float factor) const |
| Calculates the slerp of this quaternion with another given an interpolation factor. | |
| bool | IsEqualTo (const decQuaternion &q, float threshold=0.0001) const |
| Determines if the components of this quaternion are equal to another one with respect to a threshold. | |
| void | SetZero () |
| Sets all components to 0 and w to 1. | |
| void | Set (float nx, float ny, float nz, float nw) |
| Sets the components to the given values. | |
| void | Set (const decQuaternion &q) |
| Sets the quaternion from another one. | |
Operators | |
| decQuaternion | operator- () const |
| Retrieves the negation of this quaternion. | |
| decQuaternion & | operator= (const decQuaternion &q) |
| Sets the components of this quaternion to the values of another one. | |
| decQuaternion & | operator+= (const decQuaternion &q) |
| Adds the components of another quaternion to this one. | |
| decQuaternion & | operator-= (const decQuaternion &q) |
| Subtracts the components of another quaternion from this quaternion. | |
| decQuaternion & | operator*= (float k) |
| Multiplies the components of this quaternion with a value k. | |
| decQuaternion & | operator/= (float k) |
| Divides the components of this quaternion by a value k. | |
| decQuaternion | operator+ (const decQuaternion &q) const |
| Retrieves a new quaternion with the sum of this quaternion with another one. | |
| decQuaternion | operator- (const decQuaternion &q) const |
| Retrieves a new quaternion with the difference of this quaternion to another one. | |
| decQuaternion | operator* (float k) const |
| Retrieves a new quaternion with this quaternion scaled by k. | |
| decQuaternion | operator* (const decQuaternion &q) const |
| Retrieves a new quaternion with this quaternion multiplied by another quaternion. | |
| decQuaternion | operator/ (float k) const |
| Retrieves a new quaternion with this quaternion divided by k. | |
| decVector | operator* (const decVector &v) const |
| Rotate a vector by this quaternion. | |
| decDVector | operator* (const decDVector &v) const |
| Rotate a vector by this quaternion. | |
| bool | operator< (const decQuaternion &q) const |
| Determines if all the components of this quaternion are less then the components of another one. | |
| bool | operator> (const decQuaternion &q) const |
| Determines if all the components of this quaternion are greater then the components of another one. | |
| bool | operator<= (const decQuaternion &q) const |
| Determines if all the components of this quaternion are less then or equal to the components of another one. | |
| bool | operator>= (const decQuaternion &q) const |
| Determines if all the components of this quaternion are greater then or equal to the components of another one. | |
Public Attributes | |
| float | w |
| W Component of quaternion. | |
| float | x |
| X Component of quaternion. | |
| float | y |
| Y Component of quaternion. | |
| float | z |
| Z Component of quaternion. | |
4 Component Quaternion.
| decQuaternion::decQuaternion | ( | ) | [inline] |
Creates a new quaternion initialized to no rotation.
Referenced by Conjugate(), operator*(), operator+(), operator-(), and operator/().
| decQuaternion::decQuaternion | ( | float | nx, |
| float | ny, | ||
| float | nz, | ||
| float | nw | ||
| ) | [inline] |
| decQuaternion::decQuaternion | ( | const decQuaternion & | q ) | [inline] |
| decQuaternion decQuaternion::Conjugate | ( | ) | const [inline] |
Retrieves the conjugation of this quaternion.
References decQuaternion(), w, x, y, and z.
| bool decQuaternion::IsEqualTo | ( | const decQuaternion & | q, |
| float | threshold = 0.0001 |
||
| ) | const |
Determines if the components of this quaternion are equal to another one with respect to a threshold.
| float decQuaternion::Length | ( | ) | const |
Retrieves the length of the quaternion.
| void decQuaternion::Normalize | ( | ) |
Normalizes the quaternion.
If the length of the quaternion is 0 an exception is thrown.
| decQuaternion decQuaternion::operator* | ( | float | k ) | const [inline] |
Retrieves a new quaternion with this quaternion scaled by k.
References decQuaternion(), w, x, y, and z.
| decQuaternion decQuaternion::operator* | ( | const decQuaternion & | q ) | const [inline] |
Retrieves a new quaternion with this quaternion multiplied by another quaternion.
References decQuaternion(), w, x, y, and z.
Rotate a vector by this quaternion.
| decDVector decQuaternion::operator* | ( | const decDVector & | v ) | const |
Rotate a vector by this quaternion.
| decQuaternion& decQuaternion::operator*= | ( | float | k ) | [inline] |
| decQuaternion decQuaternion::operator+ | ( | const decQuaternion & | q ) | const [inline] |
Retrieves a new quaternion with the sum of this quaternion with another one.
References decQuaternion(), w, x, y, and z.
| decQuaternion& decQuaternion::operator+= | ( | const decQuaternion & | q ) | [inline] |
| decQuaternion decQuaternion::operator- | ( | ) | const [inline] |
Retrieves the negation of this quaternion.
References decQuaternion(), w, x, y, and z.
| decQuaternion decQuaternion::operator- | ( | const decQuaternion & | q ) | const [inline] |
Retrieves a new quaternion with the difference of this quaternion to another one.
References decQuaternion(), w, x, y, and z.
| decQuaternion& decQuaternion::operator-= | ( | const decQuaternion & | q ) | [inline] |
| decQuaternion decQuaternion::operator/ | ( | float | k ) | const [inline] |
| decQuaternion& decQuaternion::operator/= | ( | float | k ) | [inline] |
| bool decQuaternion::operator< | ( | const decQuaternion & | q ) | const [inline] |
| bool decQuaternion::operator<= | ( | const decQuaternion & | q ) | const [inline] |
| decQuaternion& decQuaternion::operator= | ( | const decQuaternion & | q ) | [inline] |
| bool decQuaternion::operator> | ( | const decQuaternion & | q ) | const [inline] |
| bool decQuaternion::operator>= | ( | const decQuaternion & | q ) | const [inline] |
| void decQuaternion::Set | ( | const decQuaternion & | q ) | [inline] |
| void decQuaternion::Set | ( | float | nx, |
| float | ny, | ||
| float | nz, | ||
| float | nw | ||
| ) | [inline] |
| void decQuaternion::SetZero | ( | ) | [inline] |
| decQuaternion decQuaternion::Slerp | ( | const decQuaternion & | other, |
| float | factor | ||
| ) | const |
Calculates the slerp of this quaternion with another given an interpolation factor.
| float decQuaternion::w |
W Component of quaternion.
Referenced by Conjugate(), decQuaternion(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), and SetZero().
| float decQuaternion::x |
X Component of quaternion.
Referenced by Conjugate(), decQuaternion(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), and SetZero().
| float decQuaternion::y |
Y Component of quaternion.
Referenced by Conjugate(), decQuaternion(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), and SetZero().
| float decQuaternion::z |
Z Component of quaternion.
Referenced by Conjugate(), decQuaternion(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator>(), operator>=(), Set(), and SetZero().
1.7.2