This is used to store information about rotation in 3d space. More...
#include <quaternion.h>
Public Member Functions | |
Quaternion () | |
Blank Constructor. More... | |
Quaternion (const Real &X, const Real &Y, const Real &Z, const Real &W) | |
Constructor. More... | |
Quaternion (const Real &Angle, const Vector3 &Axis) | |
Axis and Rotation Constructor. More... | |
Quaternion (const Matrix3x3 &Mat) | |
Rotation Matrix Constructor. More... | |
Quaternion (const Vector3 &AxisX, const Vector3 &AxisY, const Vector3 &AxisZ) | |
Axes Constructor. More... | |
Quaternion (const btQuaternion &Theirs) | |
Bullet Quaternion constructor. More... | |
Quaternion (const Ogre::Quaternion &Theirs) | |
Ogre Quaternion constructor. More... | |
Quaternion (const Mezzanine::Quaternion &Other) | |
Copy Constructor. More... | |
Quaternion (const XML::Node &OneNode) | |
XML Constructor. More... | |
Real | DotProduct (const Quaternion &Other) const |
Gets the Dot Product of this quaternion and another quaternion. More... | |
void | ExtractBulletQuaternion (const btQuaternion &Ours) |
Copies an existing Bullet quaternion. More... | |
void | ExtractOgreQuaternion (const Ogre::Quaternion &Ours) |
Copies an existing Ogre quaternion. More... | |
btQuaternion | GetBulletQuaternion (bool normalize=false) const |
Gets a Bullet quaternion. More... | |
Quaternion | GetInverse () const |
Inverses this Quaternion. More... | |
Quaternion | GetNormalizedCopy () const |
Get a normalized copy of this Quaternion without changing this one. More... | |
Ogre::Quaternion | GetOgreQuaternion (bool normalize=false) const |
Gets a Ogre quaternion. More... | |
Real | Length () const |
Gets the length of the quaternion. More... | |
Real | LengthSqrd () const |
Gets the squared length(len^2) of the quaternion. More... | |
Quaternion & | Normalize () |
Normalizes this Quaternion. More... | |
bool | operator!= (const Mezzanine::Quaternion &Other) const |
Inequality Comparison Operator from Mezzanine::Quaternion. More... | |
bool | operator!= (const Ogre::Quaternion &Other) const |
Inequality Comparison Operator from Ogre::Quaternion. More... | |
bool | operator!= (const btQuaternion &Other) const |
Inequality Comparison Operator from btQuaternion. More... | |
Quaternion | operator* (const Real &Scalar) const |
Scaling by multiplication. More... | |
Quaternion | operator* (const Mezzanine::Quaternion &Other) const |
Multiplication operator with Mezzanine::Quaternion and Mezzanine::Quaternion. More... | |
Quaternion | operator* (const Ogre::Quaternion &Other) const |
Multiplication operator with Mezzanine::Quaternion and Ogre::Quaternion. More... | |
Quaternion | operator* (const btQuaternion &Other) const |
Multiplication operator with Mezzanine::Quaternion and btQuaternion. More... | |
Vector3 | operator* (const Vector3 &Other) const |
Rotates a vector by the provided quaternion. More... | |
Quaternion | operator+ (const Mezzanine::Quaternion &Other) const |
Addition operator with Mezzanine::Quaternion and Mezzanine::Quaternion. More... | |
Quaternion | operator+ (const Ogre::Quaternion &Other) const |
Addition operator with Mezzanine::Quaternion and Ogre::Quaternion. More... | |
Quaternion | operator+ (const btQuaternion &Other) const |
Addition operator with Mezzanine::Quaternion and btQuaternion. More... | |
Quaternion & | operator+= (const Mezzanine::Quaternion &Other) |
Incrementing operator with Mezzanine::Quaternion and Mezzanine::Quaternion. More... | |
Quaternion & | operator+= (const Ogre::Quaternion &Other) |
Incrementing operator with Mezzanine::Quaternion and Ogre::Quaternion. More... | |
Quaternion & | operator+= (const btQuaternion &Other) |
Incrementing operator with Mezzanine::Quaternion and btQuaternion. More... | |
Quaternion | operator- (const Mezzanine::Quaternion &Other) const |
Subtraction operator with Mezzanine::Quaternion and Mezzanine::Quaternion. More... | |
Quaternion | operator- (const Ogre::Quaternion &Other) const |
Subtraction operator with Mezzanine::Quaternion and Ogre::Quaternion. More... | |
Quaternion | operator- (const btQuaternion &Other) const |
Subtraction operator with Mezzanine::Quaternion and btQuaternion. More... | |
Quaternion & | operator-= (const Mezzanine::Quaternion &Other) |
Decrementing operator with Mezzanine::Quaternion and Mezzanine::Quaternion. More... | |
Quaternion & | operator-= (const Ogre::Quaternion &Other) |
Decrementing operator with Mezzanine::Quaternion and Ogre::Quaternion. More... | |
Quaternion & | operator-= (const btQuaternion &Other) |
Decrementing operator with Mezzanine::Quaternion and btQuaternion. More... | |
Quaternion | operator/ (const Real &Scalar) const |
Scaling by division. More... | |
bool | operator<= (const Mezzanine::Quaternion &Other) const |
Is every value in this Quaternion less than or equal to its corresponding value in another. More... | |
Quaternion & | operator= (const Mezzanine::Quaternion &Other) |
Assignment Operator from Mezzanine::Quaternion. More... | |
Quaternion & | operator= (const Ogre::Quaternion &Other) |
Assignment Operator from Ogre::Quaternion. More... | |
Quaternion & | operator= (const btQuaternion &Other) |
Assignment Operator from btQuaternion. More... | |
bool | operator== (const Mezzanine::Quaternion &Other) const |
Equality Comparison Operator from Mezzanine::Quaternion. More... | |
bool | operator== (const Ogre::Quaternion &Other) const |
Equality Comparison Operator from Ogre::Quaternion. More... | |
bool | operator== (const btQuaternion &Other) const |
Equality Comparison Operator from btQuaternion. More... | |
bool | operator>= (const Mezzanine::Quaternion &Other) const |
Is every value in this Quaternion greater than or equal to its corresponding value in another. More... | |
Real | operator[] (const Whole &Index) const |
Allows Array style access to the members of this class. More... | |
Real & | operator[] (const Whole &Index) |
Allows Array style access to the members of this class. More... | |
void | ProtoDeSerialize (const XML::Node &OneNode) |
Take the data stored in an XML and overwrite this instance of this object with it. More... | |
void | ProtoSerialize (XML::Node &CurrentRoot) const |
Convert this class to an XML::Node ready for serialization. More... | |
void | SetFromAxes (const Vector3 &AxisX, const Vector3 &AxisY, const Vector3 &AxisZ) |
Generates and sets the values of this quaternion from 3 Axis vectors. More... | |
void | SetFromAxisAngle (const Real &Angle, const Vector3 &Axis) |
Generates and sets the values of this quaternion to a rotation from an axis and angle on that axis. More... | |
void | SetFromMatrix3x3 (const Matrix3x3 &Mat) |
Sets this quaternions values to express the same rotation as a Matrix3x3. More... | |
void | SetIdentity () |
Sets default/identity values to the members of this quaternion. | |
void | SetValues (const Real &X, const Real &Y, const Real &Z, const Real &W) |
Sets the individual values of this quaterion directly. | |
Static Public Member Functions | |
static String | SerializableName () |
Get the name of the the XML tag this class will leave behind as its instances are serialized. More... | |
Public Attributes | |
Real | W |
Rotation on the Axis X, Y and Z defined. | |
Real | X |
The X component of the Axis. | |
Real | Y |
The Y component of the Axis. | |
Real | Z |
The Z component of the Axis. | |
This is used to store information about rotation in 3d space.
This is used to store information about rotation in 3d space. The X, Y and Z are used to identify a ray from the origin (0,0,0), about which W represents an amount of rotation.
Definition at line 68 of file quaternion.h.
Mezzanine::Quaternion::Quaternion | ( | ) |
Blank Constructor.
Basic no-initialization constructor.
Definition at line 61 of file quaternion.cpp.
Mezzanine::Quaternion::Quaternion | ( | const Real & | X, |
const Real & | Y, | ||
const Real & | Z, | ||
const Real & | W | ||
) |
Constructor.
Constructor that sets all four axis' of rotation.
X | The X component of the Axis. |
Y | The Y component of the Axis. |
Z | The Z component of the Axis. |
W | Rotation on the Axis X, Y and Z defined. |
Definition at line 64 of file quaternion.cpp.
Axis and Rotation Constructor.
This assembles a quaternion based on an axis and a rotation in radians.
Angle | Real representing the angle to be applied along the axis in radians. |
Axis | Vector3 representing the axis to apply the rotation. |
Definition at line 67 of file quaternion.cpp.
Mezzanine::Quaternion::Quaternion | ( | const Matrix3x3 & | Mat) |
Rotation Matrix Constructor.
Mat | The matrix to set this quaternion from. |
Definition at line 70 of file quaternion.cpp.
Mezzanine::Quaternion::Quaternion | ( | const Vector3 & | AxisX, |
const Vector3 & | AxisY, | ||
const Vector3 & | AxisZ | ||
) |
Axes Constructor.
AxisX | The vector expressing the X axis. |
AxisY | The vector expressing the Y axis. |
AxisZ | The vector expressing the Z axis. |
Definition at line 73 of file quaternion.cpp.
|
explicit |
Bullet Quaternion constructor.
Constructor that sets all values to match the Bullet quaternion.
Theirs | The quaternion to be copied to make this quaternion. |
Definition at line 76 of file quaternion.cpp.
|
explicit |
Ogre Quaternion constructor.
Constructor that sets all values to match the Ogre quaternion.
Theirs | The quaternion to be copied to make this quaternion. |
Definition at line 79 of file quaternion.cpp.
Mezzanine::Quaternion::Quaternion | ( | const Mezzanine::Quaternion & | Other) |
Copy Constructor.
Other | The Quaternion to copy. |
Definition at line 82 of file quaternion.cpp.
|
explicit |
XML Constructor.
OneNode | The XML node to deserialize from. |
Definition at line 90 of file quaternion.cpp.
Real Mezzanine::Quaternion::DotProduct | ( | const Quaternion & | Other) | const |
Gets the Dot Product of this quaternion and another quaternion.
Other | The other quaternion to calculate the dot product from. |
Definition at line 172 of file quaternion.cpp.
void Mezzanine::Quaternion::ExtractBulletQuaternion | ( | const btQuaternion & | Ours) |
Copies an existing Bullet quaternion.
This function will copy the values stored in an existing Bullet quaternion and set the values of this class to be the same.
Ours | The quaternion to be extracted. |
Definition at line 224 of file quaternion.cpp.
void Mezzanine::Quaternion::ExtractOgreQuaternion | ( | const Ogre::Quaternion & | Ours) |
Copies an existing Ogre quaternion.
This function will copy the values stored in an existing Ogre quaternion and set the values of this class to be the same.
Ours | The quaternion to be extracted. |
Definition at line 244 of file quaternion.cpp.
btQuaternion Mezzanine::Quaternion::GetBulletQuaternion | ( | bool | normalize = false ) | const |
Gets a Bullet quaternion.
Creates a Bullet quaternion with values equal to this class and returns it.
normalize | Whether or not you want this function to normalize the quaternion for you. |
Definition at line 212 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::GetInverse | ( | ) | const |
Inverses this Quaternion.
Definition at line 197 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::GetNormalizedCopy | ( | ) | const |
Get a normalized copy of this Quaternion without changing this one.
Definition at line 193 of file quaternion.cpp.
Ogre::Quaternion Mezzanine::Quaternion::GetOgreQuaternion | ( | bool | normalize = false ) | const |
Gets a Ogre quaternion.
Creates a Ogre quaternion with values equal to this class and returns it.
normalize | Whether or not you want this function to normalize the quaternion for you. |
Definition at line 232 of file quaternion.cpp.
Real Mezzanine::Quaternion::Length | ( | ) | const |
Gets the length of the quaternion.
Definition at line 177 of file quaternion.cpp.
Real Mezzanine::Quaternion::LengthSqrd | ( | ) | const |
Gets the squared length(len^2) of the quaternion.
Definition at line 182 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::Normalize | ( | ) |
Normalizes this Quaternion.
Definition at line 187 of file quaternion.cpp.
bool Mezzanine::Quaternion::operator!= | ( | const Mezzanine::Quaternion & | Other) | const |
Inequality Comparison Operator from Mezzanine::Quaternion.
Other | The other quaternion to compare with. |
Definition at line 456 of file quaternion.cpp.
bool Mezzanine::Quaternion::operator!= | ( | const Ogre::Quaternion & | Other) | const |
Inequality Comparison Operator from Ogre::Quaternion.
Other | The other quaternion to compare with. |
Definition at line 459 of file quaternion.cpp.
bool Mezzanine::Quaternion::operator!= | ( | const btQuaternion & | Other) | const |
Inequality Comparison Operator from btQuaternion.
Other | The other quaternion to compare with. |
Definition at line 462 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator* | ( | const Real & | Scalar) | const |
Scaling by multiplication.
Scalar | This is the amount to scale the quaternion by. |
Definition at line 284 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator* | ( | const Mezzanine::Quaternion & | Other) | const |
Multiplication operator with Mezzanine::Quaternion and Mezzanine::Quaternion.
Other | The other Quaternion to multiply from this one. |
Definition at line 317 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator* | ( | const Ogre::Quaternion & | Other) | const |
Multiplication operator with Mezzanine::Quaternion and Ogre::Quaternion.
Other | The other Quaternion to multiply from this one. |
Definition at line 328 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator* | ( | const btQuaternion & | Other) | const |
Multiplication operator with Mezzanine::Quaternion and btQuaternion.
Other | The other Quaternion to multiply from this one. |
Definition at line 339 of file quaternion.cpp.
Rotates a vector by the provided quaternion.
Other | The vector to rotate. |
Definition at line 353 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator+ | ( | const Mezzanine::Quaternion & | Other) | const |
Addition operator with Mezzanine::Quaternion and Mezzanine::Quaternion.
Other | The other Quaternion to add to this one. |
Definition at line 299 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator+ | ( | const Ogre::Quaternion & | Other) | const |
Addition operator with Mezzanine::Quaternion and Ogre::Quaternion.
Other | The other Quaternion to add to this one. |
Definition at line 302 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator+ | ( | const btQuaternion & | Other) | const |
Addition operator with Mezzanine::Quaternion and btQuaternion.
Other | The other Quaternion to add to this one. |
Definition at line 305 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::operator+= | ( | const Mezzanine::Quaternion & | Other) |
Incrementing operator with Mezzanine::Quaternion and Mezzanine::Quaternion.
Other | The other Quaternion to add to this one. |
Definition at line 367 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::operator+= | ( | const Ogre::Quaternion & | Other) |
Incrementing operator with Mezzanine::Quaternion and Ogre::Quaternion.
Other | The other Quaternion to add to this one. |
Definition at line 376 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::operator+= | ( | const btQuaternion & | Other) |
Incrementing operator with Mezzanine::Quaternion and btQuaternion.
Other | The other Quaternion to add to this one. |
Definition at line 385 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator- | ( | const Mezzanine::Quaternion & | Other) | const |
Subtraction operator with Mezzanine::Quaternion and Mezzanine::Quaternion.
Other | The other Quaternion to subtract from this one. |
Definition at line 308 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator- | ( | const Ogre::Quaternion & | Other) | const |
Subtraction operator with Mezzanine::Quaternion and Ogre::Quaternion.
Other | The other Quaternion to subtract from this one. |
Definition at line 311 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator- | ( | const btQuaternion & | Other) | const |
Subtraction operator with Mezzanine::Quaternion and btQuaternion.
Other | The other Quaternion to subtract from this one. |
Definition at line 314 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::operator-= | ( | const Mezzanine::Quaternion & | Other) |
Decrementing operator with Mezzanine::Quaternion and Mezzanine::Quaternion.
Other | The other Quaternion to subtract from this one. |
Definition at line 394 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::operator-= | ( | const Ogre::Quaternion & | Other) |
Decrementing operator with Mezzanine::Quaternion and Ogre::Quaternion.
Other | The other Quaternion to subtract from this one. |
Definition at line 403 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::operator-= | ( | const btQuaternion & | Other) |
Decrementing operator with Mezzanine::Quaternion and btQuaternion.
Other | The other Quaternion to subtract from this one. |
Definition at line 412 of file quaternion.cpp.
Quaternion Mezzanine::Quaternion::operator/ | ( | const Real & | Scalar) | const |
Scaling by division.
Scalar | This is the amount to scale the quaternion by. |
Definition at line 289 of file quaternion.cpp.
bool Mezzanine::Quaternion::operator<= | ( | const Mezzanine::Quaternion & | Other) | const |
Is every value in this Quaternion less than or equal to its corresponding value in another.
Other | The Quaternion on the right hand side of the sign. |
Definition at line 465 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::operator= | ( | const Mezzanine::Quaternion & | Other) |
Assignment Operator from Mezzanine::Quaternion.
Other | The other quaternion to overwrite this one. |
Definition at line 423 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::operator= | ( | const Ogre::Quaternion & | Other) |
Assignment Operator from Ogre::Quaternion.
Other | The other quaternion to overwrite this one. |
Definition at line 438 of file quaternion.cpp.
Quaternion & Mezzanine::Quaternion::operator= | ( | const btQuaternion & | Other) |
Assignment Operator from btQuaternion.
Other | The other quaternion to overwrite this one. |
Definition at line 432 of file quaternion.cpp.
bool Mezzanine::Quaternion::operator== | ( | const Mezzanine::Quaternion & | Other) | const |
Equality Comparison Operator from Mezzanine::Quaternion.
Other | The other quaternion to compare with. |
Definition at line 447 of file quaternion.cpp.
bool Mezzanine::Quaternion::operator== | ( | const Ogre::Quaternion & | Other) | const |
Equality Comparison Operator from Ogre::Quaternion.
Other | The other quaternion to compare with. |
Definition at line 450 of file quaternion.cpp.
bool Mezzanine::Quaternion::operator== | ( | const btQuaternion & | Other) | const |
Equality Comparison Operator from btQuaternion.
Other | The other quaternion to compare with. |
Definition at line 453 of file quaternion.cpp.
bool Mezzanine::Quaternion::operator>= | ( | const Mezzanine::Quaternion & | Other) | const |
Is every value in this Quaternion greater than or equal to its corresponding value in another.
Other | The Quaternion on the right hand side of the sign. |
Definition at line 467 of file quaternion.cpp.
Allows Array style access to the members of this class.
Index | The number corresponding to the Index you want. 0 = X, 1 = Y, 2 = Z, 3 = W. |
Definition at line 255 of file quaternion.cpp.
Allows Array style access to the members of this class.
Index | The number corresponding to the Index you want. 0 = X, 1 = Y, 2 = Z, 3 = W. |
Definition at line 268 of file quaternion.cpp.
void Mezzanine::Quaternion::ProtoDeSerialize | ( | const XML::Node & | OneNode) |
Take the data stored in an XML and overwrite this instance of this object with it.
OneNode | and XML::Node containing the data. |
Definition at line 495 of file quaternion.cpp.
void Mezzanine::Quaternion::ProtoSerialize | ( | XML::Node & | CurrentRoot) | const |
Convert this class to an XML::Node ready for serialization.
CurrentRoot | The point in the XML hierarchy that all this quaternion should be appended to. |
Definition at line 471 of file quaternion.cpp.
|
static |
Get the name of the the XML tag this class will leave behind as its instances are serialized.
Definition at line 513 of file quaternion.cpp.
void Mezzanine::Quaternion::SetFromAxes | ( | const Vector3 & | AxisX, |
const Vector3 & | AxisY, | ||
const Vector3 & | AxisZ | ||
) |
Generates and sets the values of this quaternion from 3 Axis vectors.
AxisX | The vector expressing the X axis. |
AxisY | The vector expressing the Y axis. |
AxisZ | The vector expressing the Z axis. |
Definition at line 155 of file quaternion.cpp.
Generates and sets the values of this quaternion to a rotation from an axis and angle on that axis.
Angle | Real representing the angle to be applied along the axis in radians. |
Axis | Vector3 representing the axis to apply the rotation. |
Definition at line 112 of file quaternion.cpp.
void Mezzanine::Quaternion::SetFromMatrix3x3 | ( | const Matrix3x3 & | Mat) |
Sets this quaternions values to express the same rotation as a Matrix3x3.
Mat | The matrix to set this quaternion from. |
Definition at line 122 of file quaternion.cpp.