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

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

coord is a position/rotation pair. More...

#include <Coord.h>

Collaboration diagram for gmtl::Coord:

Collaboration graph
[legend]
List of all members.

Public Types

typedef POS_TYPE::DataType DataType
typedef POS_TYPE PosDataType
typedef ROT_TYPE RotDataType
enum  Params { PosSize = POS_TYPE::Size, RotSize = ROT_TYPE::Size }

Public Methods

 Coord ()
 Coord (const Coord< POS_TYPE, ROT_TYPE > &coord)
 Coord (const POS_TYPE &pos, const ROT_TYPE &rot)
const POS_TYPE & getPos () const
const ROT_TYPE & getRot () const
POS_TYPE & pos ()
 accessor to the position element. More...

ROT_TYPE & rot ()
 accessor to the rotation element. More...

Multi-arg Constructors
Construct objects from primitive types Just assigns values in order to the pos and rot members' members.

 Coord (DataType a0, DataType a1, DataType a2, DataType a3, DataType a4, DataType a5)
 Coord (DataType a0, DataType a1, DataType a2, DataType a3, DataType a4, DataType a5, DataType a6)
 Coord (DataType a0, DataType a1, DataType a2, DataType a3, DataType a4, DataType a5, DataType a6, DataType a7)

Public Attributes

POS_TYPE mPos
 const accessor to the rotation element. More...

ROT_TYPE mRot

Detailed Description

template<typename POS_TYPE, typename ROT_TYPE>
class gmtl::Coord< POS_TYPE, ROT_TYPE >

coord is a position/rotation pair.

coord consists of a position element and a rotation element.

"How to define an Vector/Euler pair (32 bit float precision):"

    Coord<Vec3f, EulerAngleXYZf> myEulerCoord;

"Or use the built in typedefs:"

    CoordVec3fEulerAngleXYZf myEulerCoord;
    Coord3fQuat myOtherEulerCoord;
See also:
Vec, AxisAngle, EulerAngle

Definition at line 65 of file Coord.h.


Member Typedef Documentation

template<typename POS_TYPE, typename ROT_TYPE>
typedef POS_TYPE::DataType gmtl::Coord::DataType
 

Definition at line 72 of file Coord.h.

Referenced by Coord.

template<typename POS_TYPE, typename ROT_TYPE>
typedef POS_TYPE gmtl::Coord::PosDataType
 

Definition at line 73 of file Coord.h.

template<typename POS_TYPE, typename ROT_TYPE>
typedef ROT_TYPE gmtl::Coord::RotDataType
 

Definition at line 74 of file Coord.h.


Member Enumeration Documentation

template<typename POS_TYPE, typename ROT_TYPE>
enum gmtl::Coord::Params
 

Enumeration values:
PosSize 
RotSize 

Definition at line 75 of file Coord.h.

00076    {
00077        PosSize = POS_TYPE::Size,
00078        RotSize = ROT_TYPE::Size
00079    };


Constructor & Destructor Documentation

template<typename POS_TYPE, typename ROT_TYPE>
gmtl::Coord< POS_TYPE, ROT_TYPE >::Coord   [inline]
 

Definition at line 68 of file Coord.h.

References mPos, and mRot.

00068            : mPos(), mRot()
00069    {
00070    }

template<typename POS_TYPE, typename ROT_TYPE>
gmtl::Coord< POS_TYPE, ROT_TYPE >::Coord const Coord< POS_TYPE, ROT_TYPE > &    coord [inline]
 

Definition at line 81 of file Coord.h.

References mPos, and mRot.

00081                                                    : mPos( coord.mPos ), mRot( coord.mRot )
00082    {
00083    }

template<typename POS_TYPE, typename ROT_TYPE>
gmtl::Coord< POS_TYPE, ROT_TYPE >::Coord const POS_TYPE &    pos,
const ROT_TYPE &    rot
[inline]
 

Definition at line 85 of file Coord.h.

References mPos, mRot, pos, and rot.

00085                                                      : mPos( pos ), mRot( rot )
00086    {
00087    }

template<typename POS_TYPE, typename ROT_TYPE>
gmtl::Coord< POS_TYPE, ROT_TYPE >::Coord DataType    a0,
DataType    a1,
DataType    a2,
DataType    a3,
DataType    a4,
DataType    a5
[inline]
 

Definition at line 94 of file Coord.h.

References DataType, GMTL_STATIC_ASSERT, gmtlASSERT, mPos, mRot, PosSize, and RotSize.

00095    {
00096       GMTL_STATIC_ASSERT(PosSize == 3);   // "Using incorrect number of args for type size");
00097       GMTL_STATIC_ASSERT(RotSize == 3);   // "Using incorrect number of args for type size");
00098       if(PosSize == 3)
00099       {
00100          mPos[0] = a0; mPos[1] = a1; mPos[2] = a2;
00101          mRot[0] = a3; mRot[1] = a4; mRot[2] = a5; 
00102       }
00103       else
00104       {
00105          gmtlASSERT(false && "Constructor not supported for pos size");
00106       }
00107    }

template<typename POS_TYPE, typename ROT_TYPE>
gmtl::Coord< POS_TYPE, ROT_TYPE >::Coord DataType    a0,
DataType    a1,
DataType    a2,
DataType    a3,
DataType    a4,
DataType    a5,
DataType    a6
[inline]
 

Definition at line 109 of file Coord.h.

References DataType, GMTL_STATIC_ASSERT, gmtlASSERT, mPos, mRot, PosSize, and RotSize.

00110    {
00111       GMTL_STATIC_ASSERT( (PosSize == 3 && RotSize == 4) || (PosSize == 4 && RotSize == 3)); // "Using incorrect number of args for type size");
00112       if(PosSize == 3)
00113       {
00114          mPos[0] = a0; mPos[1] = a1; mPos[2] = a2;
00115          mRot[0] = a3; mRot[1] = a4; mRot[2] = a5; mRot[3] = a6; 
00116       }
00117       else if(PosSize == 4)
00118       {
00119          mPos[0] = a0; mPos[1] = a1; mPos[2] = a2; mPos[3] = a3;
00120          mRot[0] = a4; mRot[1] = a5; mRot[2] = a6; 
00121       }
00122       else
00123       {
00124          gmtlASSERT(false && "Constructor not supported for pos size");
00125       }
00126 
00127    }

template<typename POS_TYPE, typename ROT_TYPE>
gmtl::Coord< POS_TYPE, ROT_TYPE >::Coord DataType    a0,
DataType    a1,
DataType    a2,
DataType    a3,
DataType    a4,
DataType    a5,
DataType    a6,
DataType    a7
[inline]
 

Definition at line 129 of file Coord.h.

References DataType, GMTL_STATIC_ASSERT, gmtlASSERT, mPos, mRot, PosSize, and RotSize.

00130    {
00131       GMTL_STATIC_ASSERT(PosSize == 4);    // "Using incorrect number of args for type size"
00132       GMTL_STATIC_ASSERT(RotSize == 4);    // "Using incorrect number of args for type size"
00133       if(PosSize == 4)
00134       {
00135          mPos[0] = a0; mPos[1] = a1; mPos[2] = a2; mPos[3] = a3;
00136          mRot[0] = a4; mRot[1] = a5; mRot[2] = a6; mRot[3] = a7;   
00137       }
00138       else
00139       {
00140          gmtlASSERT(false && "Constructor not supported for pos size");
00141       }
00142    }


Member Function Documentation

template<typename POS_TYPE, typename ROT_TYPE>
const POS_TYPE& gmtl::Coord< POS_TYPE, ROT_TYPE >::getPos   const [inline]
 

Definition at line 145 of file Coord.h.

References mPos.

00145 { return mPos; }

template<typename POS_TYPE, typename ROT_TYPE>
const ROT_TYPE& gmtl::Coord< POS_TYPE, ROT_TYPE >::getRot   const [inline]
 

Definition at line 146 of file Coord.h.

References mRot.

00146 { return mRot; }

template<typename POS_TYPE, typename ROT_TYPE>
POS_TYPE& gmtl::Coord< POS_TYPE, ROT_TYPE >::pos   [inline]
 

accessor to the position element.

Definition at line 152 of file Coord.h.

References mPos.

Referenced by Coord.

00152 { return mPos; }

template<typename POS_TYPE, typename ROT_TYPE>
ROT_TYPE& gmtl::Coord< POS_TYPE, ROT_TYPE >::rot   [inline]
 

accessor to the rotation element.

Definition at line 155 of file Coord.h.

References mRot.

Referenced by Coord.

00155 { return mRot; }


Member Data Documentation

template<typename POS_TYPE, typename ROT_TYPE>
POS_TYPE gmtl::Coord::mPos
 

const accessor to the rotation element.

Definition at line 164 of file Coord.h.

Referenced by Coord, getPos, and pos.

template<typename POS_TYPE, typename ROT_TYPE>
ROT_TYPE gmtl::Coord::mRot
 

Definition at line 165 of file Coord.h.

Referenced by Coord, getRot, and rot.


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