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

gmtl::EulerAngle Class Template Reference
[Abstract Data Types: Matrix, Vec, Quat, Coord, Sphere, Plane]

EulerAngle: Represents a group of euler angles. More...

#include <EulerAngle.h>

Collaboration diagram for gmtl::EulerAngle:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Params { Size = 3, Order = ROTATION_ORDER::ID }

Public Methods

 EulerAngle ()
 default constructor. More...

 EulerAngle (const EulerAngle &e)
 copy constructor. More...

 EulerAngle (DATA_TYPE p0, DATA_TYPE p1, DATA_TYPE p2)
 data constructor. More...

void set (const DATA_TYPE &p0, const DATA_TYPE &p1, const DATA_TYPE &p2)
 set data. More...

DATA_TYPE & operator[] (const unsigned i)
 Gets the ith component in this EulerAngle. More...

const DATA_TYPE & operator[] (const unsigned i) const
 Gets the ith component in this EulerAngle. More...

DATA_TYPE * getData ()
 Gets the internal array of the components. More...

const DATA_TYPE * getData () const
 Gets the internal array of the components (const version). More...


Detailed Description

template<typename DATA_TYPE, typename ROTATION_ORDER>
class gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >

EulerAngle: Represents a group of euler angles.

Euler angle can be used to represent rotations in 3-space.

To some people this rotation format can be more intuitive to specify than Matrix, Quat, or AxisAngle formatted rotation.

For efficiency and to minimize problems from gimbal-lock, you should use one of the other rotation formats instead (Quat or Matrix are preferred).

The internal data format is an array of 3 DATA_TYPE angle values, plus a RotationOrder that specifies how to build a rotation transform from the 3 angle value.

IMPORTANT: The 3 angles are in the order set getOrder(), not XYZ. The values do not swap when order is changed after setting the angles.

Precondition:
all angles are in radians.
See also:
EulerAnglef, EulerAngled , Matrix, Quat, AxisAngle

Definition at line 67 of file EulerAngle.h.


Member Enumeration Documentation

template<typename DATA_TYPE, typename ROTATION_ORDER>
enum gmtl::EulerAngle::Params
 

Enumeration values:
Size 
Order 

Definition at line 70 of file EulerAngle.h.

00070 { Size = 3, Order = ROTATION_ORDER::ID };


Constructor & Destructor Documentation

template<typename DATA_TYPE, typename ROTATION_ORDER>
gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::EulerAngle   [inline]
 

default constructor.

initializes to identity rotation (no rotation).

Definition at line 73 of file EulerAngle.h.

References gmtlASSERT.

Referenced by EulerAngle.

00074    {
00075       gmtlASSERT( ROTATION_ORDER::IS_ROTORDER == 1 && 
00076             "you must specify a RotationOrder derived type for the rotationorder in euler angle." );
00077       mData[0] = DATA_TYPE( 0 );
00078       mData[1] = DATA_TYPE( 0 );
00079       mData[2] = DATA_TYPE( 0 );
00080    }

template<typename DATA_TYPE, typename ROTATION_ORDER>
gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::EulerAngle const EulerAngle< DATA_TYPE, ROTATION_ORDER > &    e [inline]
 

copy constructor.

Definition at line 83 of file EulerAngle.h.

References EulerAngle.

00084    {
00085       mData[0] = e.mData[0];
00086       mData[1] = e.mData[1];
00087       mData[2] = e.mData[2];
00088    }

template<typename DATA_TYPE, typename ROTATION_ORDER>
gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::EulerAngle DATA_TYPE    p0,
DATA_TYPE    p1,
DATA_TYPE    p2
[inline]
 

data constructor.

angles are in radians.

Definition at line 91 of file EulerAngle.h.

00092    {
00093       mData[0] = p0;
00094       mData[1] = p1;
00095       mData[2] = p2;
00096    }


Member Function Documentation

template<typename DATA_TYPE, typename ROTATION_ORDER>
const DATA_TYPE* gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::getData   const [inline]
 

Gets the internal array of the components (const version).

Returns:
a pointer to the component array with length SIZE

Definition at line 134 of file EulerAngle.h.

00134 { return mData; }

template<typename DATA_TYPE, typename ROTATION_ORDER>
DATA_TYPE* gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::getData   [inline]
 

Gets the internal array of the components.

Returns:
a pointer to the component array with length SIZE

Definition at line 129 of file EulerAngle.h.

00129 { return mData; }

template<typename DATA_TYPE, typename ROTATION_ORDER>
const DATA_TYPE& gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::operator[] const unsigned    i const [inline]
 

Gets the ith component in this EulerAngle.

Parameters:
i  the zero-based index of the component to access.
Precondition:
0 <= i < 3
Returns:
a reference to the ith component

Definition at line 118 of file EulerAngle.h.

References gmtlASSERT, and Size.

00119    {
00120       gmtlASSERT( i < Size );
00121       return mData[i];
00122    }

template<typename DATA_TYPE, typename ROTATION_ORDER>
DATA_TYPE& gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::operator[] const unsigned    i [inline]
 

Gets the ith component in this EulerAngle.

Parameters:
i  the zero-based index of the component to access.
Precondition:
0 <= i < 3
Returns:
a reference to the ith component

Definition at line 113 of file EulerAngle.h.

References gmtlASSERT, and Size.

00114    {
00115       gmtlASSERT( i < Size );
00116       return mData[i];
00117    }

template<typename DATA_TYPE, typename ROTATION_ORDER>
void gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::set const DATA_TYPE &    p0,
const DATA_TYPE &    p1,
const DATA_TYPE &    p2
[inline]
 

set data.

angles are in radians.

Definition at line 99 of file EulerAngle.h.

00101    {
00102       mData[0] = p0;
00103       mData[1] = p1;
00104       mData[2] = p2;
00105    }


The documentation for this class was generated from the following file:
Generated on Mon Apr 7 15:29:27 2003 for GenericMathTemplateLibrary by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002