#include <gls_quaternion.h>
|  | 
|  | GlsQuaternion () | 
|  | 
|  | GlsQuaternion (Type x, Type y, Type z, Type w) | 
|  | 
|  | GlsQuaternion (Type angle, const Vector &axis) | 
|  | 
|  | GlsQuaternion (Type angle1, const Vector &axis1, Type angle2, const Vector &axis2, Type angle3, const Vector &axis3) | 
|  | 
|  | GlsQuaternion (Type angleX, Type angleY, Type angleZ) | 
|  | 
|  | GlsQuaternion (const Vector &anglesVec) | 
|  | 
|  | GlsQuaternion (const GlsMatrixAffine< Type > &matrix) | 
|  | 
| Type * | Data () | 
|  | 
| const Type * | Data () const | 
|  | 
| bool | operator== (const GlsQuaternion &q) const | 
|  | 
| bool | operator!= (const GlsQuaternion &q) const | 
|  | 
| bool | operator< (const GlsQuaternion &q) const | 
|  | 
| const GlsQuaternion | operator* (Type s) const | 
|  | 
| GlsQuaternion & | operator*= (Type s) | 
|  | 
| const GlsQuaternion | operator* (const GlsQuaternion &q) const | 
|  | 
| GlsQuaternion & | operator*= (const GlsQuaternion &q) | 
|  | 
| GlsQuaternion | operator/ (Type s) const | 
|  | 
| GlsQuaternion & | operator/= (Type s) | 
|  | 
| const GlsQuaternion | operator/ (const GlsQuaternion &q) const | 
|  | 
| GlsQuaternion & | operator/= (const GlsQuaternion &q) | 
|  | 
| const GlsQuaternion | operator+ (const GlsQuaternion &q) const | 
|  | 
| GlsQuaternion & | operator+= (const GlsQuaternion &q) | 
|  | 
| const GlsQuaternion | operator- (const GlsQuaternion &q) const | 
|  | 
| GlsQuaternion & | operator-= (const GlsQuaternion &q) | 
|  | 
| const GlsQuaternion | operator- () const | 
|  | 
| Type | Magnitude () const | 
|  | 
| Type | MagnitudeSquared () const | 
|  | 
| GlsQuaternion | Conjugate () const | 
|  | 
| const GlsQuaternion | Inverse () const | 
|  | 
| Type | DotProduct (const GlsQuaternion &q) const | 
|  | 
| void | Normalize () | 
|  | 
| void | Set (Type x, Type y, Type z, Type w) | 
|  | 
| void | SetFromAngleAxis (Type angle, const Vector &axis) | 
|  | 
| void | SetFromAngleAxis (Type angle1, const Vector &axis1, Type angle2, const Vector &axis2, Type angle3, const Vector &axis3) | 
|  | 
| void | SetFromEulerAngles (Type angleX, Type angleY, Type angleZ) | 
|  | 
| void | SetFromVectors (const Vector &to, const Vector &from) | 
|  | 
| void | SetFromRotationMatrix (const GlsMatrixAffine< Type > &matrix) | 
|  | 
| Type | GetRoll (void) const | 
|  | 
| Type | GetPitch (void) const | 
|  | 
| Type | GetYaw (void) const | 
|  | 
| Vector | GetEulerAngles () | 
|  | 
| void | GetAngleAxis (Type *angle, Vector *axis) | 
|  | 
| GlsMatrixAffine< Type > | GetRotationMatrix () | 
|  | 
| void | SetFromSlerp (float t, const GlsQuaternion &from, const GlsQuaternion &to, bool adjustSign=true) | 
|  | 
template<class Type>
class disti::GlsQuaternion< Type >
The GlsQuaternion class 
Default constructor. This will initialize the quaternion to zero. 
 
 
Constructor. Sets quaternion from 4 constants. 
- Parameters
- 
  
    | x | Initial X value |  | y | Initial Y value |  | z | Initial Z value |  | w | Initial W value |  
 
 
 
Constructor. Sets quaternion from angle about an arbitrary axis 
- Parameters
- 
  
    | angle | Rotation angle in radians |  | axis | Unit vector representing arbitrary axis |  
 
 
 
Constructor. Sets quaternion from 3 angles about 3 axes 
- Parameters
- 
  
    | angle1 | Rotation angle about first axis in radians |  | axis1 | Unit vector representing first arbitrary axis |  | angle2 | Rotation angle about second axis in radians |  | axis2 | Unit vector representing second arbitrary axis |  | angle3 | Rotation angle about third axis in radians |  | axis3 | Unit vector representing third arbitrary axis |  
 
 
 
Constructor. Sets quaternion from 3 angles (Euler Angles) 
- Parameters
- 
  
    | angleX | Rotation angle about X axis in radians |  | angleY | Rotation angle about Y axis in radians |  | angleZ | Rotation angle about Z axis in radians |  
 
 
 
Constructor. Sets quaternion from 3 angles (Euler Angles) 
- Parameters
- 
  
    | anglesVec | A vector where each component of the vector is an Euler angle component in radians. |  
 
 
 
Constructor. Sets quaternion from a rotation matrix 
- Parameters
- 
  
    | matrix | An affine matrix representing a rotation matrix |  
 
 
 
Returns the conjugate of the quaternion 
- Returns
- The conjugate of the quaternion 
 
 
Accessor method providing access to quaternion data. 
- Returns
- A pointer to the quaternion data. 
 
 
  
  | 
        
          | const Type* Data | ( |  | ) | const |  | inline | 
 
Accessor method providing access to quaternion data. 
- Returns
- A pointer to the quaternion data. 
 
 
Returns the dot product of the quaternion and a supplied quaternion 
- Parameters
- 
  
    | q | A quaternion to multiply against this quaternion |  
 
- Returns
- The dot product of the quaternion and a supplied quaternion 
 
 
  
  | 
        
          | void GetAngleAxis | ( | Type * | angle, |  
          |  |  | Vector * | axis |  
          |  | ) |  |  |  | inline | 
 
Gets the rotation angle (radians) and the axis about which the angle is rotated. 
- Parameters
- 
  
    | angle | Returns the angle of rotation of the quaternion |  | axis | Returns the axis of rotation of the quaternion |  
 
 
 
Returns the Euler Angles as a Vector (Warning: SLOW) 
- Returns
- The Euler Angles as a Vector 
 
 
  
  | 
        
          | Type GetPitch | ( | void |  | ) | const |  | inline | 
 
Returns the rotation about the Y axis 
- Returns
- The rotation about the Y axis 
 
 
  
  | 
        
          | Type GetRoll | ( | void |  | ) | const |  | inline | 
 
Returns the rotation about the X axis 
- Returns
- The rotation about the X axis 
 
 
Returns a rotation matrix representation of the quaternion. 
- Returns
- The rotation matrix computed from the quaternion 
 
 
  
  | 
        
          | Type GetYaw | ( | void |  | ) | const |  | inline | 
 
Returns the rotation about the Z axis 
- Returns
- The rotation about the Z axis 
 
 
Returns the inverse of the quaternion 
- Returns
- The inverse of the quaternion 
 
 
Returns the magnitude of the quaternion 
- Returns
- The magnitude of the quaternion 
 
 
  
  | 
        
          | Type MagnitudeSquared | ( |  | ) | const |  | inline | 
 
Returns the magnitude squared of the quaternion 
- Returns
- The magnitude squared of the quaternion 
 
 
Normalizes this quaternion 
 
 
Boolean non-equivalence operator 
- Parameters
- 
  
    | q | Quaternion to compare against |  
 
- Returns
- True if the two quaternions are not exactly equal 
 
 
Scalar multiplication operator 
- Parameters
- 
  
    | s | A scalar to multiply against |  
 
- Returns
- This quaternion multiplied by the scalar 
 
 
Quaternion multiplication operator 
- Parameters
- 
  
    | q | A quaternion to multiply against |  
 
- Returns
- This quaternion multiplied by the quaternion 
 
 
Scalar multiplication operator and assignment operator 
- Parameters
- 
  
    | s | A scalar to multiply against |  
 
- Returns
- This quaternion multiplied by the scalar 
 
 
Quaternion multiplication operator 
- Parameters
- 
  
    | q | A quaternion to multiply against |  
 
- Returns
- This quaternion multiplied by the quaternion 
 
 
Quaternion addition operator 
- Parameters
- 
  
  
- Returns
- This quaternion plus the supplied quaternion 
 
 
Quaternion addition and assignment operator 
- Parameters
- 
  
  
- Returns
- This quaternion plus the supplied quaternion 
 
 
Quaternion subtrtaction operator 
- Parameters
- 
  
    | q | A quaternion to subtract |  
 
- Returns
- This quaternion minus the supplied quaternion 
 
 
Negation operator - returns the negative of the quaternion. Basically just calls operator - () on the Vec4 
 
 
Quaternion subtraction and assignment operator 
- Parameters
- 
  
    | q | A quaternion to subtract |  
 
- Returns
- This quaternion minus the supplied quaternion 
 
 
Scalar division operator 
- Parameters
- 
  
  
- Returns
- This quaternion divided by the scalar 
 
 
Quaternion division operator 
- Parameters
- 
  
    | q | A quaternion to division by |  
 
- Returns
- This quaternion divided by the quaternion 
 
 
Scalar division and assignment operator 
- Parameters
- 
  
  
- Returns
- This quaternion divided by the scalar 
 
 
Quaternion division operator 
- Parameters
- 
  
    | q | A quaternion to division by |  
 
- Returns
- This quaternion divided by the quaternion 
 
 
Boolean less than operator 
- Parameters
- 
  
    | q | Quaternion to compare against |  
 
- Returns
- True if the this quaternion is less than the provided one 
 
 
Boolean equivalence operator 
- Parameters
- 
  
    | q | Quaternion to compare against |  
 
- Returns
- True if the two quaternions are exactly equal 
 
 
  
  | 
        
          | void Set | ( | Type | x, |  
          |  |  | Type | y, |  
          |  |  | Type | z, |  
          |  |  | Type | w |  
          |  | ) |  |  |  | inline | 
 
Sets the component values for this quaternion 
- Parameters
- 
  
    | x | The X value |  | y | The Y value |  | z | The Z value |  | w | The W value |  
 
 
 
  
  | 
        
          | void SetFromAngleAxis | ( | Type | angle, |  
          |  |  | const Vector & | axis |  
          |  | ) |  |  |  | inline | 
 
Sets quaternion from angle about an arbitrary axis 
- Parameters
- 
  
    | angle | Rotation angle in radians |  | axis | Unit vector representing arbitrary axis |  
 
 
 
  
  | 
        
          | void SetFromAngleAxis | ( | Type | angle1, |  
          |  |  | const Vector & | axis1, |  
          |  |  | Type | angle2, |  
          |  |  | const Vector & | axis2, |  
          |  |  | Type | angle3, |  
          |  |  | const Vector & | axis3 |  
          |  | ) |  |  |  | inline | 
 
Sets quaternion from three angle-axis pairs. 
- Parameters
- 
  
    | angle1 | Rotation angle in radians |  | axis1 | Unit vector representing arbitrary axis |  | angle2 | Rotation angle in radians |  | axis2 | Unit vector representing arbitrary axis |  | angle3 | Rotation angle in radians |  | axis3 | Unit vector representing arbitrary axis |  
 
 
 
  
  | 
        
          | void SetFromEulerAngles | ( | Type | angleX, |  
          |  |  | Type | angleY, |  
          |  |  | Type | angleZ |  
          |  | ) |  |  |  | inline | 
 
Sets quaternion from the Euler angles. 
- Parameters
- 
  
    | angleX | The X Euler angle in radians |  | angleY | The Y Euler angle in radians |  | angleZ | The Z Euler angle in radians |  
 
 
 
Sets this quaternion from the specified rotation matrix. 
- Parameters
- 
  
    | matrix | The rotation matrix |  
 
 
 
Sets this quaternion to an interpolated rotation between the from and to vectors using spherical linear interpolation (slerp). 
- Parameters
- 
  
    | t | Percent of interpelation (0.0 -> 1.0) |  | from | The starting quaternion |  | to | The ending quaternion |  | adjustSign | Whether or not to negate the sign of the to quaternion |  
 
 
 
  
  | 
        
          | void SetFromVectors | ( | const Vector & | to, |  
          |  |  | const Vector & | from |  
          |  | ) |  |  |  | inline | 
 
Sets this quaternion to a rotation that rotates 'to' into 'from'. 
- Parameters
- 
  
    | to | The rotation destination |  | from | The rotation start point |  
 
 
 
The documentation for this class was generated from the following file: