# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NLMISC::CQuatT Template Class Reference

A Template quaternion. More...

#include <quat.h>

Inheritance diagram for NLMISC::CQuatT

Inheritance graph
[legend]
List of all members.

Public Methods

 CQuatT ()
 CQuatT (T X, T Y, T Z, T W)
 CQuatT (const CVector &axis, float angle)
 ctor of a UNIT quaternion, from an angle axis. More...

 CQuatT (const CAngleAxis &aa)
 ctor of a UNIT quaternion, from an angle axis. More...

void set (T X, T Y, T Z, T W)
bool operator== (const CQuatT& a) const
bool equal (const CQuatT& a, float epsilon = 1E-6f) const
void identity ()
bool isIdentity () const
CQuatT& operator+= (const CQuatT&o)
CQuatT& operator-= (const CQuatT&o)
CQuatT& operator *= (T f)
CQuatT& operator/= (T f)
CQuatT operator+ (const CQuatT&o) const
CQuatT operator- (const CQuatT&o) const
CQuatT operator * (T f) const
CQuatT operator/ (T f) const
CQuatT operator- () const
CQuatT operator+ () const
sqrnorm () const
 return the square of the norm of the 4D vector. More...

norm () const
 return the norm of the 4D vector. More...

void normalize ()
 Normalize the quaternion. More...

CQuatT normed () const
 Return the quaternion normalized. More...

CQuatT operator * (const CQuatT&) const
 Quaternion multiplication/composition. More...

CQuatT& operator *= (const CQuatT&)
void invert ()
 Invert this quaternion. If normalized, conjugate is faster and does same thing. More...

CQuatT inverted () const
 return the quaternion inverted. More...

CQuatT conjugate () const
 return the conjugate of this quaternion. More...

CVector getAxis () const
 Return the equivalent Unit axis of this quaternion. More...

float getAngle () const
 Return the equivalent angle of this quaternion. (in radian). More...

CAngleAxis getAngleAxis () const
 Return the equivalent Unit AngleAxis of this quaternion. More...

void setAngleAxis (const CVector &axis, float angle)
 Build a UNIT quaternion from an AngleAxis. More...

void setAngleAxis (const CAngleAxis &angAxis)
 Build a UNIT quaternion from an AngleAxis. More...

CQuatT log ()
 compute logn quaternion. More...

CQuatT exp ()
 compute quaternion exponent. More...

void makeClosest (const CQuatT &o)
 ensure that *this and q are on same side of hypersphere, ie dotProduct(*this,q) is >0, modifying this if necessary. More...

void serial (IStream &f)
 serial. More...


Public Attributes

x
y
z
w

Static Public Methods

dotProduct (const CQuatT<T> &q0, const CQuatT<T> &q1)
 Return the dotProduct of 2 quaternions. More...

CQuatT slerp (const CQuatT<T>& q0, const CQuatT<T>& q1, float t)
 Quaternion spherical linear interpolation. More...

CQuatT squad (const CQuatT<T>& q0, const CQuatT<T>& tgtQ0, const CQuatT<T>& tgtQ1, const CQuatT<T>& q1, float t)
 Quaternion Quadratic spherical linear interpolation. More...

CQuatT squadrev (const CAngleAxis &rot, const CQuatT<T>& q0, const CQuatT<T>& tgtQ0, const CQuatT<T>& tgtQ1, const CQuatT<T>& q1, float t)
 Quaternion Quadratic spherical linear interpolation, with multi revision support. More...

CQuatT lnDif (const CQuatT &q0, const CQuatT &q1)
 compute lnDiff of q0.inverted()*q1. More...


Detailed Description

template<class T> template class NLMISC::CQuatT

A Template quaternion.

Use CQuat and CQuatD.

Author(s):
Antoine Viau. , Nevrax France
Date:
2000

Definition at line 74 of file quat.h.


Constructor & Destructor Documentation

template<classT>
NLMISC::CQuatT<T>::CQuatT<T> ( ) [inline]
 

Definition at line 84 of file quat.h.

template<classT>
NLMISC::CQuatT<T>::CQuatT<T> ( T X,
T Y,
T Z,
T W ) [inline]
 

Definition at line 85 of file quat.h.

template<classT>
NLMISC::CQuatT<T>::CQuatT<T> ( const CVector & axis,
float angle ) [inline]
 

ctor of a UNIT quaternion, from an angle axis.

Definition at line 87 of file quat.h.

template<classT>
NLMISC::CQuatT<T>::CQuatT<T> ( const CAngleAxis & aa ) [inline]
 

ctor of a UNIT quaternion, from an angle axis.

Definition at line 89 of file quat.h.


Member Function Documentation

template<classT>
CQuatT<T> NLMISC::CQuatT<T>::conjugate ( ) const [inline]
 

return the conjugate of this quaternion.

Definition at line 139 of file quat.h.

template<classT>
T NLMISC::CQuatT< T >::dotProduct ( const CQuatT< T >& q0,
const CQuatT< T >& q1 ) [static]
 

Return the dotProduct of 2 quaternions.

Definition at line 309 of file quat.h.

template<classT>
bool NLMISC::CQuatT< T >::equal ( const CQuatT<T> & a,
float epsilon = 1E-6f ) const [inline]
 

Definition at line 227 of file quat.h.

template<classT>
CQuatT< T > NLMISC::CQuatT< T >::exp ( )
 

compute quaternion exponent.

Definition at line 445 of file quat.h.

template<classT>
float NLMISC::CQuatT<T>::getAngle ( ) const [inline]
 

Return the equivalent angle of this quaternion. (in radian).

Definition at line 148 of file quat.h.

template<classT>
CAngleAxis NLMISC::CQuatT<T>::getAngleAxis ( ) const [inline]
 

Return the equivalent Unit AngleAxis of this quaternion.

Definition at line 150 of file quat.h.

template<classT>
CVector NLMISC::CQuatT<T>::getAxis ( ) const [inline]
 

Return the equivalent Unit axis of this quaternion.

Definition at line 146 of file quat.h.

template<classT>
void NLMISC::CQuatT<T>::identity ( ) [inline]
 

Definition at line 102 of file quat.h.

template<classT>
void NLMISC::CQuatT< T >::invert ( ) [inline]
 

Invert this quaternion. If normalized, conjugate is faster and does same thing.

Definition at line 265 of file quat.h.

template<classT>
CQuatT<T> NLMISC::CQuatT<T>::inverted ( ) const [inline]
 

return the quaternion inverted.

Definition at line 137 of file quat.h.

template<classT>
bool NLMISC::CQuatT<T>::isIdentity ( ) const [inline]
 

Definition at line 103 of file quat.h.

template<classT>
CQuatT< T > NLMISC::CQuatT< T >::lnDif ( const CQuatT<T> & q0,
const CQuatT<T> & q1 ) [static]
 

compute lnDiff of q0.inverted()*q1.

Definition at line 462 of file quat.h.

template<classT>
CQuatT< T > NLMISC::CQuatT< T >::log ( )
 

compute logn quaternion.

Definition at line 427 of file quat.h.

template<classT>
void NLMISC::CQuatT< T >::makeClosest ( const CQuatT<T> & o )
 

ensure that *this and q are on same side of hypersphere, ie dotProduct(*this,q) is >0, modifying this if necessary.

Definition at line 473 of file quat.h.

template<classT>
T NLMISC::CQuatT<T>::norm ( ) const [inline]
 

return the norm of the 4D vector.

Definition at line 121 of file quat.h.

template<classT>
void NLMISC::CQuatT< T >::normalize ( ) [inline]
 

Normalize the quaternion.

Definition at line 280 of file quat.h.

template<classT>
CQuatT<T> NLMISC::CQuatT<T>::normed ( ) const [inline]
 

Return the quaternion normalized.

Definition at line 125 of file quat.h.

template<classT>
CQuatT< T > NLMISC::CQuatT< T >::operator * ( const CQuatT<T> & o ) const [inline]
 

Quaternion multiplication/composition.

Definition at line 242 of file quat.h.

template<classT>
CQuatT<T> NLMISC::CQuatT<T>::operator * ( T f ) const [inline]
 

Definition at line 114 of file quat.h.

template<classT>
CQuatT< T >& NLMISC::CQuatT< T >::operator *= ( const CQuatT<T> & o ) [inline]
 

Definition at line 256 of file quat.h.

template<classT>
CQuatT<T> & NLMISC::CQuatT<T>::operator *= ( T f ) [inline]
 

Definition at line 110 of file quat.h.

template<classT>
CQuatT<T> NLMISC::CQuatT<T>::operator+ ( ) const [inline]
 

Definition at line 117 of file quat.h.

template<classT>
CQuatT<T> NLMISC::CQuatT<T>::operator+ ( const CQuatT<T> & o ) const [inline]
 

Definition at line 112 of file quat.h.

template<classT>
CQuatT<T> & NLMISC::CQuatT<T>::operator+= ( const CQuatT<T> & o ) [inline]
 

Definition at line 108 of file quat.h.

template<classT>
CQuatT<T> NLMISC::CQuatT<T>::operator- ( ) const [inline]
 

Definition at line 116 of file quat.h.

template<classT>
CQuatT<T> NLMISC::CQuatT<T>::operator- ( const CQuatT<T> & o ) const [inline]
 

Definition at line 113 of file quat.h.

template<classT>
CQuatT<T> & NLMISC::CQuatT<T>::operator-= ( const CQuatT<T> & o ) [inline]
 

Definition at line 109 of file quat.h.

template<classT>
CQuatT<T> NLMISC::CQuatT<T>::operator/ ( T f ) const [inline]
 

Definition at line 115 of file quat.h.

template<classT>
CQuatT<T> & NLMISC::CQuatT<T>::operator/= ( T f ) [inline]
 

Definition at line 111 of file quat.h.

template<classT>
bool NLMISC::CQuatT<T>::operator== ( const CQuatT<T> & a ) const [inline]
 

Definition at line 100 of file quat.h.

template<classT>
void NLMISC::CQuatT<T>::serial ( IStream & f ) [inline]
 

serial.

Definition at line 168 of file quat.h.

template<classT>
void NLMISC::CQuatT<T>::set ( T X,
T Y,
T Z,
T W ) [inline]
 

Definition at line 95 of file quat.h.

template<classT>
void NLMISC::CQuatT<T>::setAngleAxis ( const CAngleAxis & angAxis ) [inline]
 

Build a UNIT quaternion from an AngleAxis.

Definition at line 155 of file quat.h.

template<classT>
void NLMISC::CQuatT< T >::setAngleAxis ( const CVector & axis,
float angle ) [inline]
 

Build a UNIT quaternion from an AngleAxis.

Definition at line 294 of file quat.h.

template<classT>
CQuatT< T > NLMISC::CQuatT< T >::slerp ( const CQuatT< T >& q0,
const CQuatT< T >& q1,
float t ) [static]
 

Quaternion spherical linear interpolation.

when t==0, ret==q0, when t==1, ret==q1. No hemisphere correction is made.

Definition at line 317 of file quat.h.

Referenced by NL3D::CAnimatedValueBlendable< NLMISC::CQuat >::blend().

template<classT>
T NLMISC::CQuatT<T>::sqrnorm ( ) const [inline]
 

return the square of the norm of the 4D vector.

Definition at line 119 of file quat.h.

template<classT>
CQuatT< T > NLMISC::CQuatT< T >::squad ( const CQuatT< T >& q0,
const CQuatT< T >& tgtQ0,
const CQuatT< T >& tgtQ1,
const CQuatT< T >& q1,
float t ) [static]
 

Quaternion Quadratic spherical linear interpolation.

when t==0, ret==q0, when t==1, ret==q1. No hemisphere correction is made.

Definition at line 355 of file quat.h.

template<classT>
CQuatT< T > NLMISC::CQuatT< T >::squadrev ( const CAngleAxis & rot,
const CQuatT< T >& q0,
const CQuatT< T >& tgtQ0,
const CQuatT< T >& tgtQ1,
const CQuatT< T >& q1,
float t ) [static]
 

Quaternion Quadratic spherical linear interpolation, with multi revision support.

Definition at line 366 of file quat.h.


Member Data Documentation

template<classT>
T NLMISC::CQuatT<T>::w
 

Definition at line 77 of file quat.h.

template<classT>
T NLMISC::CQuatT<T>::x
 

Definition at line 77 of file quat.h.

template<classT>
T NLMISC::CQuatT<T>::y
 

Definition at line 77 of file quat.h.

template<classT>
T NLMISC::CQuatT<T>::z
 

Definition at line 77 of file quat.h.


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