EulerAngle: Represents a group of euler angles. More...
#include <EulerAngle.h>
Public Types | |
enum | Params { Size = 3, Order = ROTATION_ORDER::ID } |
typedef DATA_TYPE | DataType |
Use this to declare single value types of the same type as this object. | |
Public Member Functions | |
EulerAngle () | |
default constructor. | |
EulerAngle (const EulerAngle &e) | |
copy constructor. | |
EulerAngle (DATA_TYPE p0, DATA_TYPE p1, DATA_TYPE p2) | |
data constructor. | |
void | set (const DATA_TYPE &p0, const DATA_TYPE &p1, const DATA_TYPE &p2) |
set data. | |
DATA_TYPE & | operator[] (const unsigned i) |
Gets the ith component in this EulerAngle. | |
const DATA_TYPE & | operator[] (const unsigned i) const |
DATA_TYPE * | getData () |
Gets the internal array of the components. | |
const DATA_TYPE * | getData () const |
Gets the internal array of the components (const version). |
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.
Definition at line 38 of file EulerAngle.h.
typedef DATA_TYPE gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::DataType |
Use this to declare single value types of the same type as this object.
Definition at line 42 of file EulerAngle.h.
enum gmtl::EulerAngle::Params |
Definition at line 44 of file EulerAngle.h.
gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::EulerAngle | ( | ) | [inline] |
default constructor.
initializes to identity rotation (no rotation).
Definition at line 47 of file EulerAngle.h.
{ gmtlASSERT( ROTATION_ORDER::IS_ROTORDER == 1 && "you must specify a RotationOrder derived type for the rotationorder in euler angle." ); mData[0] = DATA_TYPE( 0 ); mData[1] = DATA_TYPE( 0 ); mData[2] = DATA_TYPE( 0 ); }
gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::EulerAngle | ( | const EulerAngle< DATA_TYPE, ROTATION_ORDER > & | e | ) | [inline] |
copy constructor.
Definition at line 57 of file EulerAngle.h.
{ mData[0] = e.mData[0]; mData[1] = e.mData[1]; mData[2] = e.mData[2]; }
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 65 of file EulerAngle.h.
{ mData[0] = p0; mData[1] = p1; mData[2] = p2; }
DATA_TYPE* gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::getData | ( | ) | [inline] |
Gets the internal array of the components.
Definition at line 103 of file EulerAngle.h.
{ return mData; }
const DATA_TYPE* gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::getData | ( | ) | const [inline] |
Gets the internal array of the components (const version).
Definition at line 108 of file EulerAngle.h.
{ return mData; }
DATA_TYPE& gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::operator[] | ( | const unsigned | i | ) | [inline] |
Gets the ith component in this EulerAngle.
i | the zero-based index of the component to access. |
Definition at line 87 of file EulerAngle.h.
{ gmtlASSERT( i < Size ); return mData[i]; }
const DATA_TYPE& gmtl::EulerAngle< DATA_TYPE, ROTATION_ORDER >::operator[] | ( | const unsigned | i | ) | const [inline] |
Definition at line 92 of file EulerAngle.h.
{ gmtlASSERT( i < Size ); return mData[i]; }
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 73 of file EulerAngle.h.
{ mData[0] = p0; mData[1] = p1; mData[2] = p2; }