MercuryODEWorld Class Reference

A complete ODE world with objects that can interact with one another. More...

#include <MercuryODE.h>

Inheritance diagram for MercuryODEWorld:

Inheritance graph
[legend]
Collaboration diagram for MercuryODEWorld:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MercuryODEWorld ()
virtual ~MercuryODEWorld ()
virtual void Init ()
bool LoadFromINI (MercuryINI &pINI, const MString &sWorldName)
 Load world from a World INI file.
void AddToWorld (MercuryODEObject *toAdd)
 Add an ODE Object to this world, not a normal object.
MercuryODEObjectGenAndAddToWorld (MercuryINI &pINI, const MString &sItemName, const MString &sItemType, const MString &sClass, bool bBodied, const MercuryPoint &pInitialPosition)
 Add an object to the world by a given name generated from a world file.
virtual bool RemoveObject (MercuryObject *object, bool bAllowDelete=true)
 Remove the object from this world completely.
MercuryODEObjectGetODEObjectByName (const MString &name)
 Obtain a pointer to an object in this world by it's name.
dSpaceID GetWorldSpaceID ()
 Obtain the world Space's ID.
dWorldID GetWorldID ()
 Obtain the world's ODE ID.
virtual void Update (const float fDeltaTime)
 [internal] Update (call this update last when abstracting because Update can destroy the object)
void SetGravity (const float fGravity)
 Set gravity vector for world to <0,0,-fGravity>.
 CLASS_RTTI (MercuryODEWorld, MercuryObject)
MHash< MercuryODEObject * > & GetAllObjectMap ()

Public Attributes

dJointGroupID m_oJointGroup
 Temp data (used in the update cycle).

Protected Attributes

MHash< MercuryODEObject * > m_mObjects
 Map of all object by name.
dWorldID m_oWorld
 World's ODE ID.
dSpaceID m_oSpace
 World Space's ID.
dGeomID m_oGround
 Special: We have a plane for the ground.

Friends

void nearCallback (void *data, dGeomID o1, dGeomID o2)
 The collision function will need full reign over our class.

Detailed Description

A complete ODE world with objects that can interact with one another.

Beginning Notes: MercuryODE is very tricky, and seems a little strange. MercuryODE's interface tries to make the use of objects in ODE as easy as possible. I have done as much as I could to keep the speed fast.

When it comes to actually writing your own objects, make sure you can't just write them into the world's INI file, then use the World's GetODEObjectByName() function to obtain a MercuryObject version of the object. MercuryODE will handle making the object for you, you can then manipulate it however you please. You can also use it to obtain it's position and and whatnot. If you cannot have MercuyODEWorld display something, you can use invisible objects.

For complex world objects, it is suggested you have a model that doesn't use ODE, then having a shape that doesn't get displayed for ODE.

Definition at line 128 of file MercuryODE.h.


Constructor & Destructor Documentation

MercuryODEWorld::MercuryODEWorld (  ) 

Definition at line 416 of file MercuryODE.cpp.

MercuryODEWorld::~MercuryODEWorld (  )  [virtual]

Definition at line 439 of file MercuryODE.cpp.


Member Function Documentation

void MercuryODEWorld::Init (  )  [virtual]

Reimplemented from MercuryObject.

Definition at line 420 of file MercuryODE.cpp.

bool MercuryODEWorld::LoadFromINI ( MercuryINI pINI,
const MString sWorldName 
)

Load world from a World INI file.

Definition at line 451 of file MercuryODE.cpp.

void MercuryODEWorld::AddToWorld ( MercuryODEObject toAdd  ) 

Add an ODE Object to this world, not a normal object.

Definition at line 528 of file MercuryODE.cpp.

MercuryODEObject * MercuryODEWorld::GenAndAddToWorld ( MercuryINI pINI,
const MString sItemName,
const MString sItemType,
const MString sClass,
bool  bBodied,
const MercuryPoint pInitialPosition 
)

Add an object to the world by a given name generated from a world file.

Definition at line 506 of file MercuryODE.cpp.

bool MercuryODEWorld::RemoveObject ( MercuryObject object,
bool  bAllowDelete = true 
) [virtual]

Remove the object from this world completely.

Reimplemented from MercuryObject.

Definition at line 534 of file MercuryODE.cpp.

MercuryODEObject* MercuryODEWorld::GetODEObjectByName ( const MString name  )  [inline]

Obtain a pointer to an object in this world by it's name.

Definition at line 149 of file MercuryODE.h.

dSpaceID MercuryODEWorld::GetWorldSpaceID (  )  [inline]

Obtain the world Space's ID.

Definition at line 152 of file MercuryODE.h.

dWorldID MercuryODEWorld::GetWorldID (  )  [inline]

Obtain the world's ODE ID.

Definition at line 155 of file MercuryODE.h.

void MercuryODEWorld::Update ( const float  dTime  )  [virtual]

[internal] Update (call this update last when abstracting because Update can destroy the object)

Reimplemented from MercuryObject.

Definition at line 593 of file MercuryODE.cpp.

void MercuryODEWorld::SetGravity ( const float  fGravity  ) 

Set gravity vector for world to <0,0,-fGravity>.

Definition at line 616 of file MercuryODE.cpp.

MercuryODEWorld::CLASS_RTTI ( MercuryODEWorld  ,
MercuryObject   
)

MHash<MercuryODEObject *>& MercuryODEWorld::GetAllObjectMap (  )  [inline]

Definition at line 164 of file MercuryODE.h.


Friends And Related Function Documentation

void nearCallback ( void *  data,
dGeomID  o1,
dGeomID  o2 
) [friend]

The collision function will need full reign over our class.

Definition at line 550 of file MercuryODE.cpp.


Member Data Documentation

dJointGroupID MercuryODEWorld::m_oJointGroup

Temp data (used in the update cycle).

Definition at line 167 of file MercuryODE.h.

MHash< MercuryODEObject * > MercuryODEWorld::m_mObjects [protected]

Map of all object by name.

Definition at line 170 of file MercuryODE.h.

dWorldID MercuryODEWorld::m_oWorld [protected]

World's ODE ID.

Definition at line 173 of file MercuryODE.h.

dSpaceID MercuryODEWorld::m_oSpace [protected]

World Space's ID.

Definition at line 176 of file MercuryODE.h.

dGeomID MercuryODEWorld::m_oGround [protected]

Special: We have a plane for the ground.

Definition at line 179 of file MercuryODE.h.


The documentation for this class was generated from the following files:
Hosted by SourceForge.net Logo