#include <quaternion.h>
It is based on the quaternion class by Sobiet Void (robin@cyberversion.com). From the url http://www.gamedev.net/reference/articles/article1095.asp. This is a template version so no implementation file is present. The header file contains both the declarationand the implementation.
Definition at line 53 of file quaternion.h.
Public Member Functions | |
Quaternion () | |
The default constructor. | |
Quaternion (const T w, const T x, const T y, const T z) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. With this version the individual components of the quaternion can be set. | |
Quaternion (const T xAngle, const T yAngle, const T zAngle) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This version allows creation of a quaternion from an Euler representation. | |
Quaternion (const Vector3D< T > v, const T angle) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This version allows creation of a quaternion from an axis/angle representation. | |
~Quaternion () | |
The default destructor. | |
Quaternion | operator * (const Quaternion &quat) |
Implements quaternion multiplication. | |
Quaternion & | operator= (const Quaternion &quat) |
The copy constructor. | |
void | identity () |
Sets the quaternion to the identity quaternion (1, 0, 0, 0). | |
void | normalize () |
Normalizes the quaternion. | |
void | setValues (const T w, const T x, const T y, const T z) |
Sets the quaternion to the given values. | |
void | conjugate () |
Changes the quaternion into its conjugate. | |
void | inverse () |
Changes the quaternion into its inverse. | |
T | w () const |
Returns the w-value of the quaternion. | |
T | x () const |
Returns the x-value of the quaternion. | |
T | y () const |
Returns the y-value of the quaternion. | |
T | z () const |
Returns the z-value of the quaternion. | |
void | eulerToQuaternion (const T xAngle, const T yAngle, const T zAngle) |
Returns a quaternion constructed from 3 Euler angles (in degrees). | |
void | axisToQuaternion (const Vector3D< T > v, const T angle) |
Returns a quaternion constructed from an axis/angle representation (in degrees). | |
void | getAxisAngle (Vector3D< T > &v, T &angle) |
Returns the axis (vector) - angle (in degrees) representation of the quaternion. | |
Private Member Functions | |
void | limitRange (const T minimum, T &value, const T maximum) |
Limits the range of value between minimum and maximum. | |
Private Attributes | |
T | wQuat |
T | xQuat |
T | yQuat |
T | zQuat |
Internal quaternion representation (w, xi, yj, zk). |
|
The default constructor.
Definition at line 97 of file quaternion.h. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. With this version the individual components of the quaternion can be set.
Definition at line 104 of file quaternion.h. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This version allows creation of a quaternion from an Euler representation.
Definition at line 112 of file quaternion.h. |
|
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This version allows creation of a quaternion from an axis/angle representation.
Definition at line 120 of file quaternion.h. |
|
The default destructor.
Definition at line 128 of file quaternion.h. |
|
Implements quaternion multiplication.
Definition at line 134 of file quaternion.h. |
|
The copy constructor.
Definition at line 146 of file quaternion.h. |
|
Sets the quaternion to the identity quaternion (1, 0, 0, 0).
Definition at line 158 of file quaternion.h. |
|
Normalizes the quaternion.
Definition at line 168 of file quaternion.h. |
|
Sets the quaternion to the given values.
Definition at line 201 of file quaternion.h. |
|
Changes the quaternion into its conjugate.
Definition at line 223 of file quaternion.h. |
|
Changes the quaternion into its inverse.
Definition at line 232 of file quaternion.h. |
|
Returns the w-value of the quaternion.
Definition at line 244 of file quaternion.h. |
|
Returns the x-value of the quaternion.
Definition at line 251 of file quaternion.h. |
|
Returns the y-value of the quaternion.
Definition at line 258 of file quaternion.h. |
|
Returns the z-value of the quaternion.
Definition at line 265 of file quaternion.h. |
|
Returns a quaternion constructed from 3 Euler angles (in degrees).
Definition at line 272 of file quaternion.h. |
|
Returns a quaternion constructed from an axis/angle representation (in degrees).
Definition at line 299 of file quaternion.h. |
|
Returns the axis (vector) - angle (in degrees) representation of the quaternion.
Definition at line 322 of file quaternion.h. |
|
Limits the range of value between minimum and maximum.
Definition at line 348 of file quaternion.h. |
|
Definition at line 89 of file quaternion.h. |
|
Definition at line 89 of file quaternion.h. |
|
Definition at line 89 of file quaternion.h. |
|
Internal quaternion representation (w, xi, yj, zk).
Definition at line 89 of file quaternion.h. |