Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

gbmath::Quaternion Class Reference

Quaternion class for representing rotations. More...

#include <quaternion.h>

List of all members.

Public Methods

Constructors
 Quaternion (const V3 &v=V3::O, float angle=0.f, bool normalize=false)
 .

 Quaternion (const V4 &v, bool nomalize=false)
 .

 Quaternion (const Quaternion &q, bool normalize=false)
 .

 Quaternion (const Mat33 &m)
 .

 Quaternion (const Mat44 &m)
 .

Initializers
void Set (const V3 &v, float angle, bool normalize=false)
 .

void Set (const V4 &v, bool normalize=false)
 .

void Set (const Quaternion &q, bool normalize=false)
 .

void Set (const Mat33 &m)
 .

void Set (const Mat44 &m)
 .

void SetIdentity ()
 .

Overloaded operators
Quaternion operator * (const Quaternion &q) const
 .

Quaternion operator * (float d) const
 .

V3 operator * (const V3 &v) const
 .

Quaternion operator+ (const Quaternion &q) const
 .

Quaternion & operator *= (const Quaternion &q)
 .

Operations
float GetNorm () const
 .

Quaternion & Normalize ()
 .

Quaternion GetConjugate () const
 .

Quaternion GetInverse () const
 .

Quaternion & Quaternion::Slerp (const Quaternion &q1, const Quaternion &q2, float t)
 Slerp does a spherical linear interpolation between two quaternions.

Quaternion & Quaternion::RotateVToV (const V3 &start, const V3 &dest)
 .

Converters
Mat33 GetMat33 () const
 .

Mat44 GetMat44 () const
 .


Static Public Attributes

Quaternion I
 Identity Quaternion.


Detailed Description

Quaternion class for representing rotations.

Union Members: float x, y, z, w; V3 v; float w; V4 v4; float q [4];


Member Function Documentation

Quaternion& gbmath::Quaternion::Quaternion::Slerp const Quaternion &    q1,
const Quaternion &    q2,
float    t
 

Slerp does a spherical linear interpolation between two quaternions.

Calculates a Quaternion from the first to the second given an interpolation factor.

Remarks:
Slerp assumes that the quaternions are normalized and that the rotations on the first and second Quaternion are not a multiply of 2 * pi or near 2 * pi.


The documentation for this class was generated from the following files:
Generated on Mon Sep 2 14:52:33 2002 for GunBuster Engine by doxygen1.2.17