Public Member Functions | |
Quaternion () | |
Quaternion (double w, const Vector3 &v) | |
double | squareSum () const |
double | length () const |
Quaternion | operator+ (const Quaternion &q) const |
Quaternion | operator- (const Quaternion &q) const |
Quaternion | operator * (const Quaternion &q) const |
Quaternion | operator * (double f) const |
Quaternion | operator/ (double f) const |
Quaternion | operator- () const |
Quaternion & | operator+= (const Quaternion &q) |
Quaternion & | operator-= (const Quaternion &q) |
Quaternion & | operator *= (const Quaternion &q) |
For two quaternions q1 = (w1, V1) and q2 = (w1, V2) the product is defined as:. | |
Quaternion & | operator/= (const Quaternion &q) |
Quaternion & | operator *= (double f) |
Quaternion & | operator/= (double f) |
bool | operator== (const Quaternion &q) const |
bool | operator!= (const Quaternion &q) const |
void | set (const Vector3 &v, double w) |
void | negate () |
void | normalize () |
void | conjugate () |
void | inverse () |
void | setRotation (const Rotation3 &r) |
Creates a normalized quaternion represention the specified rotation. | |
void | setRotation (const Vector3 &axis, double cosineOfAngle) |
Creates a normalized quaternion represention the specified rotation. | |
void | getRotation (Rotation3 &r) const |
This method may be optimized if we know that the quaternion is a unit quaternion. | |
Static Public Member Functions | |
static const Quaternion | zero () |
static const Quaternion | one () |
Public Attributes | |
double | w |
Vector3 | v |
Definition at line 33 of file quaternion.H.
|
This method may be optimized if we know that the quaternion is a unit quaternion. Also it mat be more efficient to compute sin(a) as sqrt(1 - cos^2(a)). Definition at line 143 of file quaternion.H. References Archon::Math::Rotation3::angle, Archon::Math::Rotation3::axis, Archon::Math::sq(), Archon::Math::BasicVector< T, N >::squareSum(), v, and w. Referenced by Archon::Math::Rotation3::combineWith(), and Archon::X3D::Viewer::renderFrame(). |
|
For two quaternions q1 = (w1, V1) and q2 = (w1, V2) the product is defined as:. (w1 w2 - V1·V2, V1 × V2 + w2 V1 + w1 V2) Note: The quaternion product is not commutative. Note also that the product of two unit quaternions is again a unit quaternion. The quaternion product may be used to combine rotations. That is: Applying rotation q1 and then q2 is the same as applying the rotation q2 * q1. Definition at line 81 of file quaternion.H. References Archon::Math::dot(), v, and w. |
|
Creates a normalized quaternion represention the specified rotation. NOTE: Make sure 'axis' is a normalized vector. (cos(a/2), sin(a/2) V) Definition at line 130 of file quaternion.H. |
|
Creates a normalized quaternion represention the specified rotation. NOTE: Make sure 'r.axis' is a normalized vector. (cos(a/2), sin(a/2) V) Definition at line 116 of file quaternion.H. References Archon::Math::Rotation3::angle, Archon::Math::Rotation3::axis, v, and w. Referenced by Archon::Math::Rotation3::combineWith(), and Archon::X3D::Viewer::renderFrame(). |