Public Types | Public Member Functions | Public Attributes

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

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

#include <Coord.h>

List of all members.

Public Types

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

Public Member Functions

 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
ROT_TYPE & rot ()
 accessor to the rotation element
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 position element
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 37 of file Coord.h.


Member Typedef Documentation

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

Definition at line 44 of file Coord.h.

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

Definition at line 45 of file Coord.h.

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

Definition at line 46 of file Coord.h.


Member Enumeration Documentation

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

Definition at line 47 of file Coord.h.

   {
       PosSize = POS_TYPE::Size,
       RotSize = ROT_TYPE::Size
   };


Constructor & Destructor Documentation

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

Definition at line 40 of file Coord.h.

           : mPos(), mRot()
   {
   }

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 53 of file Coord.h.

                                                   : mPos( coord.mPos ), mRot( coord.mRot )
   {
   }

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 57 of file Coord.h.

                                                     : mPos( pos ), mRot( rot )
   {
   }

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 66 of file Coord.h.

   {
      GMTL_STATIC_ASSERT(PosSize == 3, Using_incorrect_number_of_args_for_type_size);
      GMTL_STATIC_ASSERT(RotSize == 3, Using_incorrect_number_of_args_for_type_size);
      if(PosSize == 3)
      {
         mPos[0] = a0; mPos[1] = a1; mPos[2] = a2;
         mRot[0] = a3; mRot[1] = a4; mRot[2] = a5; 
      }
      else
      {
         gmtlASSERT(false && "Constructor not supported for pos size");
      }
   }

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 81 of file Coord.h.

   {
      GMTL_STATIC_ASSERT( (PosSize == 3 && RotSize == 4) || (PosSize == 4 && RotSize == 3), Using_incorrect_number_of_args_for_type_size);
      if(PosSize == 3)
      {
         mPos[0] = a0; mPos[1] = a1; mPos[2] = a2;
         mRot[0] = a3; mRot[1] = a4; mRot[2] = a5; mRot[3] = a6; 
      }
      else if(PosSize == 4)
      {
         mPos[0] = a0; mPos[1] = a1; mPos[2] = a2; mPos[3] = a3;
         mRot[0] = a4; mRot[1] = a5; mRot[2] = a6; 
      }
      else
      {
         gmtlASSERT(false && "Constructor not supported for pos size");
      }

   }

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 101 of file Coord.h.

   {
      GMTL_STATIC_ASSERT(PosSize == 4, Using_incorrect_number_of_args_for_type_size);
      GMTL_STATIC_ASSERT(RotSize == 4, Using_incorrect_number_of_args_for_type_size);
      if(PosSize == 4)
      {
         mPos[0] = a0; mPos[1] = a1; mPos[2] = a2; mPos[3] = a3;
         mRot[0] = a4; mRot[1] = a5; mRot[2] = a6; mRot[3] = a7;   
      }
      else
      {
         gmtlASSERT(false && "Constructor not supported for pos size");
      }
   }


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 117 of file Coord.h.

{ return mPos; }

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

Definition at line 118 of file Coord.h.

{ return mRot; }

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

accessor to the position element

Todo:

what about having a pos, and a const_pos naming convention?

what about having a rot, and a const_rot naming convention?

Definition at line 124 of file Coord.h.

{ 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 127 of file Coord.h.

{ return mRot; }


Member Data Documentation

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

const accessor to the position element

const accessor to the rotation element

Definition at line 136 of file Coord.h.

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

Definition at line 137 of file Coord.h.


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