Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Quaternion Class Reference

#include <quaternion.h>

List of all members.

Operators

Quaternion operator+= (const Quaternion &)
Quaternion operator-= (const Quaternion &)
Quaternion operator *= (double)
Quaternion operator/= (double)
Quaternion operator= (const Vector3d &)
Quaternion operator~ (const Quaternion &)
Quaternion operator+ (const Quaternion &, const Quaternion &)
Quaternion operator- (const Quaternion &, const Quaternion &)
Quaternion operator * (const Quaternion &, double)
Quaternion operator/ (const Quaternion &, double)
Quaternion operator * (const Quaternion &, const Quaternion &)
Quaternion operator * (const Quaternion &, const Vector3d &)
Quaternion operator * (const Vector3d &, const Quaternion &)

Public Methods

 Quaternion ()
 Quaternion (double u, double x, double y, double z)
 Quaternion (const Vector3d &axis, double angle)
 Initialize a ROTATION quaternion with given paramaters.

string toString (void)
double module ()
Vector3d getAxis (void)
Quaternion normalize ()
Quaternion normalized ()
Rotations
Quaternion rotate (const Vector3d &v)
 Rotate the vector over the quaternion axis and angle.

Quaternion rotate (const Quaternion &q)
 Rotate q over MY axis and angle.

Quaternion rotate (const Vector3d &axis, double angle)
 Rotate ME over axis and angle.

Vector3d toWorld (const Vector3d &v)
 Convert a vector in body coordinates to a vector in world coordinates (with me as base).

Vector3d toBody (const Vector3d &v)
 Convert a vector in world coordinates to a vector in body coordinates (with me as base).

Some gets
double U ()
double X ()
double Y ()
double Z ()

Protected Attributes

double u
double x
double y
double z


Constructor & Destructor Documentation

Quaternion::Quaternion   [inline]
 

Definition at line 28 of file quaternion.cc.

References u, x, y, and z.

Referenced by normalized(), and rotate().

Quaternion::Quaternion double    u,
double    x,
double    y,
double    z
[inline]
 

Definition at line 32 of file quaternion.cc.

References u, x, y, and z.

Quaternion::Quaternion const Vector3d   axis,
double    angle
[inline]
 

Initialize a ROTATION quaternion with given paramaters.

Definition at line 39 of file quaternion.cc.

References cos(), Vector3d::normalized(), sin(), u, Vector3d::X(), x, Vector3d::Y(), y, Vector3d::Z(), and z.


Member Function Documentation

Vector3d Quaternion::getAxis void    [inline]
 

Definition at line 138 of file quaternion.cc.

References x, y, and z.

Referenced by Vector3d::operator=().

double Quaternion::module   [inline]
 

Definition at line 54 of file quaternion.cc.

References u, x, y, and z.

Referenced by normalize().

Quaternion Quaternion::normalize   [inline]
 

Definition at line 59 of file quaternion.h.

References module().

Referenced by Cylinder::applyVelocity(), Cylinder::createCylinder(), and Cylinder::Cylinder().

Quaternion Quaternion::normalized   [inline]
 

Definition at line 60 of file quaternion.h.

References Quaternion().

Quaternion Quaternion::operator *= double    [inline]
 

Definition at line 86 of file quaternion.cc.

References u, x, y, and z.

Quaternion Quaternion::operator+= const Quaternion &    [inline]
 

Definition at line 62 of file quaternion.cc.

References u, x, y, and z.

Quaternion Quaternion::operator-= const Quaternion &    [inline]
 

Definition at line 74 of file quaternion.cc.

References u, x, y, and z.

Quaternion Quaternion::operator/= double    [inline]
 

Definition at line 98 of file quaternion.cc.

References u, x, y, and z.

Quaternion Quaternion::operator= const Vector3d   [inline]
 

Definition at line 131 of file quaternion.cc.

References u, Vector3d::X(), x, Vector3d::Y(), y, Vector3d::Z(), and z.

Quaternion Quaternion::rotate const Vector3d   axis,
double    angle
[inline]
 

Rotate ME over axis and angle.

Definition at line 155 of file quaternion.cc.

References log, and Quaternion().

Quaternion Quaternion::rotate const Quaternion &    q [inline]
 

Rotate q over MY axis and angle.

This method rotates the given quaternion over ME.

Definition at line 150 of file quaternion.cc.

Quaternion Quaternion::rotate const Vector3d   v [inline]
 

Rotate the vector over the quaternion axis and angle.

Definition at line 142 of file quaternion.cc.

Vector3d Quaternion::toBody const Vector3d   v [inline]
 

Convert a vector in world coordinates to a vector in body coordinates (with me as base).

Just a rotation vs the conjugate

Definition at line 170 of file quaternion.cc.

Referenced by Collision::resolveGroundCollision().

string Quaternion::toString void    [inline]
 

Definition at line 48 of file quaternion.cc.

References u, x, y, and z.

Vector3d Quaternion::toWorld const Vector3d   v [inline]
 

Convert a vector in body coordinates to a vector in world coordinates (with me as base).

Just a rotation

Definition at line 163 of file quaternion.cc.

Referenced by Cylinder::applyForceOnBody(), Cylinder::applyVelocity(), Cylinder::checkGroundCollision(), Cylinder::Cylinder(), Collision::resolveGroundCollision(), and Cylinder::undoVelocity().

double Quaternion::U   [inline]
 

Definition at line 66 of file quaternion.h.

References u.

double Quaternion::X   [inline]
 

Definition at line 67 of file quaternion.h.

References x.

double Quaternion::Y   [inline]
 

Definition at line 68 of file quaternion.h.

References y.

double Quaternion::Z   [inline]
 

Definition at line 69 of file quaternion.h.

References z.


Friends And Related Function Documentation

Quaternion operator * const Vector3d  ,
const Quaternion &   
[friend]
 

Definition at line 124 of file quaternion.cc.

Quaternion operator * const Quaternion &   ,
const Vector3d  
[friend]
 

Definition at line 117 of file quaternion.cc.

Quaternion operator * const Quaternion &   ,
const Quaternion &   
[friend]
 

Definition at line 110 of file quaternion.cc.

Quaternion operator * const Quaternion &   ,
double   
[friend]
 

Definition at line 82 of file quaternion.cc.

Quaternion operator+ const Quaternion &   ,
const Quaternion &   
[friend]
 

Definition at line 58 of file quaternion.cc.

Quaternion operator- const Quaternion &   ,
const Quaternion &   
[friend]
 

Definition at line 70 of file quaternion.cc.

Quaternion operator/ const Quaternion &   ,
double   
[friend]
 

Definition at line 94 of file quaternion.cc.

Quaternion operator~ const Quaternion &    [friend]
 

Definition at line 106 of file quaternion.cc.


Member Data Documentation

double Quaternion::u [protected]
 

Definition at line 31 of file quaternion.h.

Referenced by module(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator~(), Quaternion(), toString(), and U().

double Quaternion::x [protected]
 

Definition at line 31 of file quaternion.h.

Referenced by getAxis(), module(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator~(), Quaternion(), toString(), and X().

double Quaternion::y [protected]
 

Definition at line 31 of file quaternion.h.

Referenced by getAxis(), module(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator~(), Quaternion(), toString(), and Y().

double Quaternion::z [protected]
 

Definition at line 31 of file quaternion.h.

Referenced by getAxis(), module(), operator *(), operator *=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator~(), Quaternion(), toString(), and Z().


The documentation for this class was generated from the following files:
Generated on Mon Jun 17 19:54:18 2002 for Svas Server by doxygen1.2.16