dtHLAGM::Spatial Class Reference

Class for encoding and decoding the RPR 2 spatial structure. More...

#include <spatial.h>

List of all members.

Public Member Functions

 Spatial (bool littleEndian=false)
 creates a spatial.
virtual ~Spatial ()
char GetDeadReckoningAlgorithm () const
void SetDeadReckoningAlgorithm (char newAlgorithm)
bool IsFrozen () const
void SetFrozen (bool newFrozen)
WorldCoordinateGetWorldCoordinate ()
const WorldCoordinateGetWorldCoordinate () const
EulerAnglesGetOrientation ()
const EulerAnglesGetOrientation () const
VelocityVectorGetVelocity ()
const VelocityVectorGetVelocity () const
VelocityVectorGetAcceleration ()
const VelocityVectorGetAcceleration () const
VelocityVectorGetAngularVelocity ()
const VelocityVectorGetAngularVelocity () const
bool HasVelocity () const
 
Returns:
true if the dead-reckoning algorithm suggests this should have a valid velocity.

bool HasAcceleration () const
 
Returns:
true if the dead-reckoning algorithm suggests this should have a valid acceleration.

bool HasAngularVelocity () const
 
Returns:
true if the dead-reckoning algorithm suggests this should have a valid angular velocity.

size_t Encode (char *buffer, size_t maxSize)
 Fills the given buffer with the encoded version of this struct.
bool Decode (const char *buffer, size_t size)
 Decodes the data in the buffer, filling this structure.


Detailed Description

Class for encoding and decoding the RPR 2 spatial structure.

This structure holds position, orientation, and motion data and the suggested dead-reckoning algorithm. The data is the encoded structure changes based on the dead-reckoning algorithm chosen.


Constructor & Destructor Documentation

dtHLAGM::Spatial::Spatial ( bool  littleEndian = false  ) 

creates a spatial.

Parameters:
littleEndian true to encode/decode in little endian. False for big endian.

dtHLAGM::Spatial::~Spatial (  )  [virtual]


Member Function Documentation

char dtHLAGM::Spatial::GetDeadReckoningAlgorithm (  )  const [inline]

void dtHLAGM::Spatial::SetDeadReckoningAlgorithm ( char  newAlgorithm  )  [inline]

bool dtHLAGM::Spatial::IsFrozen (  )  const [inline]

void dtHLAGM::Spatial::SetFrozen ( bool  newFrozen  )  [inline]

WorldCoordinate & dtHLAGM::Spatial::GetWorldCoordinate (  ) 

const WorldCoordinate & dtHLAGM::Spatial::GetWorldCoordinate (  )  const

EulerAngles & dtHLAGM::Spatial::GetOrientation (  ) 

const EulerAngles & dtHLAGM::Spatial::GetOrientation (  )  const

VelocityVector & dtHLAGM::Spatial::GetVelocity (  ) 

const VelocityVector & dtHLAGM::Spatial::GetVelocity (  )  const

VelocityVector & dtHLAGM::Spatial::GetAcceleration (  ) 

const VelocityVector & dtHLAGM::Spatial::GetAcceleration (  )  const

VelocityVector & dtHLAGM::Spatial::GetAngularVelocity (  ) 

const VelocityVector & dtHLAGM::Spatial::GetAngularVelocity (  )  const

bool dtHLAGM::Spatial::HasVelocity (  )  const

Returns:
true if the dead-reckoning algorithm suggests this should have a valid velocity.

bool dtHLAGM::Spatial::HasAcceleration (  )  const

Returns:
true if the dead-reckoning algorithm suggests this should have a valid acceleration.

bool dtHLAGM::Spatial::HasAngularVelocity (  )  const

Returns:
true if the dead-reckoning algorithm suggests this should have a valid angular velocity.

size_t dtHLAGM::Spatial::Encode ( char *  buffer,
size_t  maxSize 
)

Fills the given buffer with the encoded version of this struct.

Parameters:
buffer the buffer to fill.
maxSize the maximum size allocated in this buffer.
Returns:
the used buffer size or 0 is encoding failed, probably due to the maxSize being too small.

bool dtHLAGM::Spatial::Decode ( const char *  buffer,
size_t  size 
)

Decodes the data in the buffer, filling this structure.

Parameters:
buffer the buffer read data from.
size the size of the buffer.
Returns:
true if the data was possible to decode.

ewww, const cast, but the data stream won't use a non-const pointer.


http://www.delta3d.org
2.0.0 generated 14 Feb 2008