#include <MercuryODE.h>
Inheritance diagram for MercuryODEWorld:
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. | |
MercuryODEObject * | 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. | |
virtual bool | RemoveObject (MercuryObject *object, bool bAllowDelete=true) |
Remove the object from this world completely. | |
MercuryODEObject * | GetODEObjectByName (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. |
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.
MercuryODEWorld::MercuryODEWorld | ( | ) |
Definition at line 416 of file MercuryODE.cpp.
MercuryODEWorld::~MercuryODEWorld | ( | ) | [virtual] |
Definition at line 439 of file MercuryODE.cpp.
void MercuryODEWorld::Init | ( | ) | [virtual] |
bool MercuryODEWorld::LoadFromINI | ( | MercuryINI & | pINI, | |
const MString & | sWorldName | |||
) |
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] |
dWorldID MercuryODEWorld::GetWorldID | ( | ) | [inline] |
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 | ) |
MercuryODEWorld::CLASS_RTTI | ( | MercuryODEWorld | , | |
MercuryObject | ||||
) |
MHash<MercuryODEObject *>& MercuryODEWorld::GetAllObjectMap | ( | ) | [inline] |
Definition at line 164 of file MercuryODE.h.
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.
dJointGroupID MercuryODEWorld::m_oJointGroup |
MHash< MercuryODEObject * > MercuryODEWorld::m_mObjects [protected] |
dWorldID MercuryODEWorld::m_oWorld [protected] |
dSpaceID MercuryODEWorld::m_oSpace [protected] |
dGeomID MercuryODEWorld::m_oGround [protected] |