#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 () const |
|
Type | GetPitch () const |
|
Type | GetYaw () 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) |
|
|
Type | _v [4] |
| The four components of the quaternion.
|
|
template<class Type>
class disti::GlsQuaternion< Type >
The GlsQuaternion class
◆ GlsQuaternion() [1/7]
Default constructor. This will initialize the quaternion to zero.
◆ GlsQuaternion() [2/7]
Constructor. Sets quaternion from 4 constants.
- Parameters
-
x | Initial X value |
y | Initial Y value |
z | Initial Z value |
w | Initial W value |
◆ GlsQuaternion() [3/7]
Constructor. Sets quaternion from angle about an arbitrary axis
- Parameters
-
angle | Rotation angle in radians |
axis | Unit vector representing arbitrary axis |
◆ GlsQuaternion() [4/7]
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 |
◆ GlsQuaternion() [5/7]
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 |
◆ GlsQuaternion() [6/7]
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. |
◆ GlsQuaternion() [7/7]
Constructor. Sets quaternion from a rotation matrix
- Parameters
-
matrix | An affine matrix representing a rotation matrix |
◆ Conjugate()
Returns the conjugate of the quaternion
- Returns
- The conjugate of the quaternion
◆ Data() [1/2]
Accessor method providing access to quaternion data.
- Returns
- A pointer to the quaternion data.
◆ Data() [2/2]
const Type * Data |
( |
| ) |
const |
|
inline |
Accessor method providing access to quaternion data.
- Returns
- A pointer to the quaternion data.
◆ DotProduct()
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
◆ GetAngleAxis()
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 |
◆ GetEulerAngles()
Returns the Euler Angles as a Vector (Warning: SLOW)
- Returns
- The Euler Angles as a Vector
◆ GetPitch()
Returns the rotation about the Y axis
- Returns
- The rotation about the Y axis
◆ GetRoll()
Returns the rotation about the X axis
- Returns
- The rotation about the X axis
◆ GetRotationMatrix()
Returns a rotation matrix representation of the quaternion.
- Returns
- The rotation matrix computed from the quaternion
◆ GetYaw()
Returns the rotation about the Z axis
- Returns
- The rotation about the Z axis
◆ Inverse()
Returns the inverse of the quaternion
- Returns
- The inverse of the quaternion
◆ IsVeryCloseToZero()
static bool IsVeryCloseToZero |
( |
double |
value | ) |
|
|
inlinestaticprotected |
Circular dependancies prevent us from using VeryCloseToZero in util.h.
- Parameters
-
value | The value to compare. |
- Returns
- True if the value if close enough to zero.
◆ Magnitude()
Returns the magnitude of the quaternion
- Returns
- The magnitude of the quaternion
◆ MagnitudeSquared()
Type MagnitudeSquared |
( |
| ) |
const |
|
inline |
Returns the magnitude squared of the quaternion
- Returns
- The magnitude squared of the quaternion
◆ Normalize()
Normalizes this quaternion
◆ operator!=()
Boolean non-equivalence operator
- Parameters
-
q | Quaternion to compare against |
- Returns
- True if the two quaternions are not exactly equal
◆ operator*() [1/2]
The quaternion multiplication operator.
- Parameters
-
q | A quaternion to multiply against. |
- Returns
- This quaternion multiplied by the quaternion.
◆ operator*() [2/2]
Scalar multiplication operator
- Parameters
-
s | A scalar to multiply against |
- Returns
- This quaternion multiplied by the scalar
◆ operator*=() [1/2]
The quaternion multiplication operator.
- Parameters
-
q | A quaternion to multiply against. |
- Returns
- This quaternion multiplied by the quaternion.
◆ operator*=() [2/2]
Scalar multiplication operator and assignment operator
- Parameters
-
s | A scalar to multiply against |
- Returns
- This quaternion multiplied by the scalar
◆ operator+()
Quaternion addition operator
- Parameters
-
- Returns
- This quaternion plus the supplied quaternion
◆ operator+=()
Quaternion addition and assignment operator
- Parameters
-
- Returns
- This quaternion plus the supplied quaternion
◆ operator-() [1/2]
Negation operator - returns the negative of the quaternion. Basically just calls operator - () on the Vec4
- Returns
- The negated quaternion (this * -1).
◆ operator-() [2/2]
Quaternion subtrtaction operator
- Parameters
-
q | A quaternion to subtract |
- Returns
- This quaternion minus the supplied quaternion
◆ operator-=()
Quaternion subtraction and assignment operator
- Parameters
-
q | A quaternion to subtract |
- Returns
- This quaternion minus the supplied quaternion
◆ operator/() [1/2]
Quaternion division operator
- Parameters
-
q | A quaternion to division by |
- Returns
- This quaternion divided by the quaternion
◆ operator/() [2/2]
Scalar division operator
- Parameters
-
- Returns
- This quaternion divided by the scalar
◆ operator/=() [1/2]
Quaternion division operator
- Parameters
-
q | A quaternion to division by |
- Returns
- This quaternion divided by the quaternion
◆ operator/=() [2/2]
Scalar division and assignment operator
- Parameters
-
- Returns
- This quaternion divided by the scalar
◆ operator<()
Boolean less than operator
- Parameters
-
q | Quaternion to compare against |
- Returns
- True if the this quaternion is less than the provided one
◆ operator==()
Boolean equivalence operator
- Parameters
-
q | Quaternion to compare against |
- Returns
- True if the two quaternions are exactly equal
◆ Set()
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 |
◆ SetFromAngleAxis() [1/2]
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 |
◆ SetFromAngleAxis() [2/2]
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 |
◆ SetFromEulerAngles()
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 |
◆ SetFromRotationMatrix()
Sets this quaternion from the specified rotation matrix.
- Parameters
-
matrix | The rotation matrix |
◆ SetFromSlerp()
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 |
◆ SetFromVectors()
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: