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 Vector3 &DirectionAxis, const Vector3 &UpAxis) | |
| Rotation To Z 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... | |
| void | ConvertToAngleAxis (Real &Angle, Vector3 &Axis) const |
| Converts the rotation expressed by this Quaternion into it's individual rotation and axis components. 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 (Boole 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 (Boole 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... | |
| Boole | operator!= (const Mezzanine::Quaternion &Other) const |
| Inequality Comparison Operator from Mezzanine::Quaternion. More... | |
| Boole | operator!= (const Ogre::Quaternion &Other) const |
| Inequality Comparison Operator from Ogre::Quaternion. More... | |
| Boole | 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... | |
| Boole | 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... | |
| Boole | operator== (const Mezzanine::Quaternion &Other) const |
| Equality Comparison Operator from Mezzanine::Quaternion. More... | |
| Boole | operator== (const Ogre::Quaternion &Other) const |
| Equality Comparison Operator from Ogre::Quaternion. More... | |
| Boole | operator== (const btQuaternion &Other) const |
| Equality Comparison Operator from btQuaternion. More... | |
| Boole | 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 describe a rotation from an axis and angle on that axis. More... | |
| void | SetFromAxisToZ (const Vector3 &DirectionAxis, const Vector3 &UpAxis) |
| Generates and sets the values of this quaternion to describe a rotation from the direction axis to the Z 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. More... | |
Static Public Member Functions | |
| static String | GetSerializableName () |
| 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.
Rotation To Z constructor.
| DirectionAxis | The axis to get the rotation to Z for. |
| UpAxis | The up axis in local space. |
Definition at line 76 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 79 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 82 of file quaternion.cpp.
| Mezzanine::Quaternion::Quaternion | ( | const Mezzanine::Quaternion & | Other | ) |
Copy Constructor.
| Other | The Quaternion to copy. |
Definition at line 85 of file quaternion.cpp.
|
explicit |
XML Constructor.
| OneNode | The XML node to deserialize from. |
Definition at line 93 of file quaternion.cpp.
Converts the rotation expressed by this Quaternion into it's individual rotation and axis components.
| Angle | The amount of rotation to apply to the axis. |
| Axis | The Axis this quaternions rotation is on. |
Definition at line 190 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 203 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 255 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 275 of file quaternion.cpp.
| btQuaternion Mezzanine::Quaternion::GetBulletQuaternion | ( | Boole | 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 243 of file quaternion.cpp.
| Quaternion Mezzanine::Quaternion::GetInverse | ( | ) | const |
Inverses this Quaternion.
Definition at line 228 of file quaternion.cpp.
| Quaternion Mezzanine::Quaternion::GetNormalizedCopy | ( | ) | const |
Get a normalized copy of this Quaternion without changing this one.
Definition at line 224 of file quaternion.cpp.
| Ogre::Quaternion Mezzanine::Quaternion::GetOgreQuaternion | ( | Boole | 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 263 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 544 of file quaternion.cpp.
| Real Mezzanine::Quaternion::Length | ( | ) | const |
Gets the length of the quaternion.
Definition at line 208 of file quaternion.cpp.
| Real Mezzanine::Quaternion::LengthSqrd | ( | ) | const |
Gets the squared length(len^2) of the quaternion.
Definition at line 213 of file quaternion.cpp.
| Quaternion & Mezzanine::Quaternion::Normalize | ( | ) |
Normalizes this Quaternion.
Definition at line 218 of file quaternion.cpp.
| Boole Mezzanine::Quaternion::operator!= | ( | const Mezzanine::Quaternion & | Other | ) | const |
Inequality Comparison Operator from Mezzanine::Quaternion.
| Other | The other quaternion to compare with. |
Definition at line 487 of file quaternion.cpp.
| Boole Mezzanine::Quaternion::operator!= | ( | const Ogre::Quaternion & | Other | ) | const |
Inequality Comparison Operator from Ogre::Quaternion.
| Other | The other quaternion to compare with. |
Definition at line 490 of file quaternion.cpp.
| Boole Mezzanine::Quaternion::operator!= | ( | const btQuaternion & | Other | ) | const |
Inequality Comparison Operator from btQuaternion.
| Other | The other quaternion to compare with. |
Definition at line 493 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 315 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 348 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 359 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 370 of file quaternion.cpp.
Rotates a vector by the provided quaternion.
| Other | The vector to rotate. |
Definition at line 384 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 330 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 333 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 336 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 398 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 407 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 416 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 339 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 342 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 345 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 425 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 434 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 443 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 320 of file quaternion.cpp.
| Boole 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 496 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 454 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 469 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 463 of file quaternion.cpp.
| Boole Mezzanine::Quaternion::operator== | ( | const Mezzanine::Quaternion & | Other | ) | const |
Equality Comparison Operator from Mezzanine::Quaternion.
| Other | The other quaternion to compare with. |
Definition at line 478 of file quaternion.cpp.
| Boole Mezzanine::Quaternion::operator== | ( | const Ogre::Quaternion & | Other | ) | const |
Equality Comparison Operator from Ogre::Quaternion.
| Other | The other quaternion to compare with. |
Definition at line 481 of file quaternion.cpp.
| Boole Mezzanine::Quaternion::operator== | ( | const btQuaternion & | Other | ) | const |
Equality Comparison Operator from btQuaternion.
| Other | The other quaternion to compare with. |
Definition at line 484 of file quaternion.cpp.
| Boole 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 498 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 286 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 299 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 526 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 502 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 158 of file quaternion.cpp.
Generates and sets the values of this quaternion to describe 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 115 of file quaternion.cpp.
| void Mezzanine::Quaternion::SetFromAxisToZ | ( | const Vector3 & | DirectionAxis, |
| const Vector3 & | UpAxis | ||
| ) |
Generates and sets the values of this quaternion to describe a rotation from the direction axis to the Z axis.
| DirectionAxis | The axis to get the rotation to Z for. |
| UpAxis | The up axis in local space. |
Definition at line 175 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 125 of file quaternion.cpp.
| void Mezzanine::Quaternion::SetValues | ( | const Real & | X, |
| const Real & | Y, | ||
| const Real & | Z, | ||
| const Real & | W | ||
| ) |
Sets the individual values of this quaterion directly.
| 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 107 of file quaternion.cpp.
1.8.9.1. Thanks to the
Open Icon Library
for help with some of the icons.