#include <World.h>
Classes | |
class | ODEHolder |
Singleton used to initialize/terminate ODE when everything else is done. More... | |
Public Member Functions | |
World () | |
Builds a world and a main space. | |
World (const osg::Vec3 &worldBox) | |
Same as default constructor, but the main space is a quad space. | |
World (Space *space) | |
Same as default constructor, with an already allocated Space. | |
void | setUseQuickStep (bool flag) |
Set to true to use a faster but less precise method for step(). | |
bool | getUseQuickStep () const |
void | step (dReal stepSize) |
Perform a full iteration of the physics loop (not just ODE "step"). | |
Space * | getGlobalSpace () |
const Space * | getGlobalSpace () const |
void | setNearCallback (NearCallback *pNcb) |
NearCallback * | getNearCallback () |
const NearCallback * | getNearCallback () const |
JointGroup * | getContactGroup () |
const JointGroup * | getContactGroup () const |
operator dWorldID () | |
operator const dWorldID () const | |
Protected Member Functions | |
void | init () |
void | resetSpaceCollideFlag (Space *pCurSpace) |
Resets spaces' collide flag before calling spaceCollide(). | |
void | spaceCollide (Space *pCurSpace) |
Collides a space and all its sub-spaces if needed. | |
void | spaceCollide2 (AbstractGeom *pAGeom1, AbstractGeom *pAGeom2) |
virtual | ~World () |
Protected destructor forces the object to be deleted by being dereferenced. | |
Protected Attributes | |
dWorldID | id |
osg::ref_ptr< Space > | pSpace |
Main space. | |
osg::ref_ptr< JointGroup > | pContactGroup |
bool | bUseQuick |
NearCallback * | pNcb |
Friends | |
class | Body |
class | Joint |
class | JointGroup |
class | NearCallback |
Also contains a global space (Partition for collision detection). Internally uses a quad tree as main space structure (may be changed if a home-made octree is created outside).
Definition at line 98 of file World.h.
Physics::World::World | ( | ) |
Physics::World::World | ( | const osg::Vec3 & | worldBox | ) |
Physics::World::World | ( | Space * | space | ) |
Physics::World::~World | ( | ) | [protected, virtual] |
Protected destructor forces the object to be deleted by being dereferenced.
Also avoids the object from beeing created on the stack.
Definition at line 245 of file World.cpp.
References pContactGroup, and pSpace.
const JointGroup* Physics::World::getContactGroup | ( | ) | const [inline] |
JointGroup* Physics::World::getContactGroup | ( | ) | [inline] |
const Space* Physics::World::getGlobalSpace | ( | ) | const [inline] |
const NearCallback* Physics::World::getNearCallback | ( | ) | const [inline] |
NearCallback* Physics::World::getNearCallback | ( | ) | [inline] |
void Physics::World::init | ( | ) | [protected] |
Definition at line 228 of file World.cpp.
References Physics::dWorldSetGravity(), Util::Singleton< ODEHolder >::instance(), JointGroup, and pContactGroup.
Referenced by World().
void Physics::World::resetSpaceCollideFlag | ( | Space * | pCurSpace | ) | [protected] |
Resets spaces' collide flag before calling spaceCollide().
Definition at line 298 of file World.cpp.
References Physics::AbstractGeom::asSpace(), Physics::Space::collided, DBG_TRY_BLOCK_END, DBG_TRY_BLOCK_START, and Physics::Space::vGeoms.
Referenced by step().
void Physics::World::setNearCallback | ( | NearCallback * | pNcb | ) | [inline] |
void Physics::World::setUseQuickStep | ( | bool | flag | ) | [inline] |
void Physics::World::spaceCollide | ( | Space * | pCurSpace | ) | [protected] |
Collides a space and all its sub-spaces if needed.
Definition at line 280 of file World.cpp.
References Physics::AbstractGeom::asSpace(), Physics::AbstractGeom::asSpaceId(), Physics::Space::collided, DBG_TRY_BLOCK_END, DBG_TRY_BLOCK_START, Physics::NearCallback::toPVLENearCallback(), and Physics::Space::vGeoms.
Referenced by Physics::NearCallback::operator()(), and step().
void Physics::World::spaceCollide2 | ( | AbstractGeom * | pAGeom1, | |
AbstractGeom * | pAGeom2 | |||
) | [protected] |
Definition at line 274 of file World.cpp.
References DBG_TRY_BLOCK_END, DBG_TRY_BLOCK_START, Physics::AbstractGeom::id, and Physics::NearCallback::toPVLENearCallback().
Referenced by Physics::NearCallback::operator()().
void Physics::World::step | ( | dReal | stepSize | ) |
Perform a full iteration of the physics loop (not just ODE "step").
Definition at line 252 of file World.cpp.
References bUseQuick, DBG_TRY_BLOCK_END, DBG_TRY_BLOCK_START, pContactGroup, pSpace, resetSpaceCollideFlag(), and spaceCollide().
friend class JointGroup [friend] |
friend class NearCallback [friend] |
bool Physics::World::bUseQuick [protected] |
dWorldID Physics::World::id [mutable, protected] |
osg::ref_ptr<JointGroup> Physics::World::pContactGroup [protected] |
NearCallback* Physics::World::pNcb [protected] |
osg::ref_ptr<Space> Physics::World::pSpace [protected] |