Cyclone Cyclone: cyclone::Quaternion Class Reference

cyclone::Quaternion Class Reference

Holds a three degree of freedom orientation. More...

#include <core.h>

List of all members.

Public Member Functions

 Quaternion ()
 The default constructor creates a quaternion representing a zero rotation.
 Quaternion (const real r, const real i, const real j, const real k)
 The explicit constructor creates a quaternion with the given components.
void normalise ()
 Normalises the quaternion to unit length, making it a valid orientation quaternion.QuatNormalise.
void operator *= (const Quaternion &multiplier)
 Multiplies the quaternion by the given quaternion.QuatCombine.
void addScaledVector (const Vector3 &vector, real scale)
 Adds the given vector to this, scaled by the given amount.QuatUpdateByVel.
void rotateByVector (const Vector3 &vector)
 >QuatRotByVector QuatRotByVector >Quaternion;QuaternionIntro


Detailed Description

Holds a three degree of freedom orientation.

/<QuaternionIntro;Quaternion

Quaternions have several mathematical properties that make them useful for representing orientations, but require four items of data to hold the three degrees of freedom. These four items of data can be viewed as the coefficients of a complex number with three imaginary parts. The mathematics of the quaternion is then defined and is roughly correspondent to the math of 3D rotations. A quaternion is only a valid rotation if it is normalised: i.e. it has a length of 1.

Note:
Angular velocity and acceleration can be correctly represented as vectors. Quaternions are only needed for orientation. />QuaternionIntro;Quaternion


Constructor & Destructor Documentation

cyclone::Quaternion::Quaternion  )  [inline]
 

The default constructor creates a quaternion representing a zero rotation.

cyclone::Quaternion::Quaternion const real  r,
const real  i,
const real  j,
const real  k
[inline]
 

The explicit constructor creates a quaternion with the given components.

Parameters:
r The real component of the rigid body's orientation quaternion.
i The first complex component of the rigid body's orientation quaternion.
j The second complex component of the rigid body's orientation quaternion.
k The third complex component of the rigid body's orientation quaternion.
Note:
The given orientation does not need to be normalised, and can be zero. This function will not alter the given values, or normalise the quaternion. To normalise the quaternion (and make a zero quaternion a legal rotation), use the normalise function.
See also:
normalise


Member Function Documentation

void cyclone::Quaternion::addScaledVector const Vector3 vector,
real  scale
[inline]
 

Adds the given vector to this, scaled by the given amount.QuatUpdateByVel.

This is used to update the orientation quaternion by a rotation and time.

Parameters:
vector The vector to add.
scale The amount of the vector to add.

void cyclone::Quaternion::normalise  )  [inline]
 

Normalises the quaternion to unit length, making it a valid orientation quaternion.QuatNormalise.

void cyclone::Quaternion::operator *= const Quaternion multiplier  )  [inline]
 

Multiplies the quaternion by the given quaternion.QuatCombine.

Parameters:
multiplier The quaternion by which to multiply.

void cyclone::Quaternion::rotateByVector const Vector3 vector  )  [inline]
 

>QuatRotByVector QuatRotByVector >Quaternion;QuaternionIntro


Member Data Documentation

real cyclone::Quaternion::data[4]
 

Holds the quaternion data in array form.

real cyclone::Quaternion::i
 

Holds the first complex component of the quaternion.

real cyclone::Quaternion::j
 

Holds the second complex component of the quaternion.

real cyclone::Quaternion::k
 

Holds the third complex component of the quaternion.

real cyclone::Quaternion::r
 

Holds the real component of the quaternion.


The documentation for this class was generated from the following file: