physics::Quaternion Class Reference

#include <quaternion.h>

List of all members.

Public Member Functions

 Quaternion ()
 Quaternion (float x, float y, float z, float w)
void getAxisRotation (float &radians, float &x, float &y, float &z)
Quaternion operator* (float s) const
Quaternionoperator*= (float s)
Quaternion operator+ (const Quaternion &q) const
Quaternionoperator+= (const Quaternion &q)
Quaternion operator* (const Quaternion &q) const
Quaternionoperator*= (const Quaternion &q)
Quaternion conjugate () const
Vector3D transform (const Vector3D &p) const
Vector3D inverseTransform (const Vector3D &p) const

Static Public Member Functions

static Quaternion create (float radians, float x, float y, float z)
static Quaternion slerp (const Quaternion &a, const Quaternion &b, float t)


Detailed Description

Alternative for representing rotations. Advantages are that it does not suffer from gimble lock and produces much better interpolation.

Constructor & Destructor Documentation

physics::Quaternion::Quaternion (  )  [inline]

Create a non-oriented quaternion

physics::Quaternion::Quaternion ( float  x,
float  y,
float  z,
float  w 
) [inline]

Create a quaternion from x/y/z/w components.


Member Function Documentation

static Quaternion physics::Quaternion::create ( float  radians,
float  x,
float  y,
float  z 
) [inline, static]

Create a quaternion from a rotation about an axis. e.g. Quaternion::create(2.0, 1.0, 0.0, 0.0) = 2 radians around X. Note: x/y/z _must_ be normalised.

void physics::Quaternion::getAxisRotation ( float &  radians,
float &  x,
float &  y,
float &  z 
)

Get this quaternion as a rotation about some axis.

Quaternion physics::Quaternion::operator* ( float  s  )  const [inline]

Scale the quaternion.

Quaternion& physics::Quaternion::operator*= ( float  s  )  [inline]

Scale the quaternion.

Quaternion physics::Quaternion::operator+ ( const Quaternion q  )  const [inline]

Add two quaternions together

Quaternion& physics::Quaternion::operator+= ( const Quaternion q  )  [inline]

Add two quaternions together

Quaternion physics::Quaternion::operator* ( const Quaternion q  )  const [inline]

Multiply two quaternions together. This combines the rotation as would combining two rotation matrices.

Quaternion& physics::Quaternion::operator*= ( const Quaternion q  ) 

Multiply two quaternions together. This combines the rotation as would combining two rotation matrices.

static Quaternion physics::Quaternion::slerp ( const Quaternion a,
const Quaternion b,
float  t 
) [inline, static]

Interpolate between two quaternion rotations.

Parameters:
a Start quaternion (t = 0).
b End quaternion (t = 1).
t Interpolation value between 0 and 1.

Quaternion physics::Quaternion::conjugate (  )  const [inline]

Conjugate, a kind of inverse.

Vector3D physics::Quaternion::transform ( const Vector3D p  )  const [inline]

Transform a point by the rotation represented by this quaternion.

Vector3D physics::Quaternion::inverseTransform ( const Vector3D p  )  const [inline]

Transform a point by the inverse of the rotation represented by this quaternion.


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

Generated on Thu Apr 23 22:51:40 2009 for Large Polygon Collider - Modular 2D/3D Physics Engine by  doxygen 1.5.6