Physics::World Class Reference

Wrapper representnig the physical world. More...

#include <World.h>

List of all members.

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").
SpacegetGlobalSpace ()
const SpacegetGlobalSpace () const
void setNearCallback (NearCallback *pNcb)
NearCallbackgetNearCallback ()
const NearCallbackgetNearCallback () const
JointGroupgetContactGroup ()
const JointGroupgetContactGroup () 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< SpacepSpace
 Main space.
osg::ref_ptr< JointGrouppContactGroup
bool bUseQuick
NearCallbackpNcb

Friends

class Body
class Joint
class JointGroup
class NearCallback


Detailed Description

Wrapper representnig the physical world.

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).

Author:
Sukender
Version:
0.2.0 - Based on ODE

Definition at line 98 of file World.h.


Constructor & Destructor Documentation

Physics::World::World (  ) 

Builds a world and a main space.

The world is initialized with auto-disable features for newly created bodies, a -Z gravity, and quickStep activated.

Definition at line 213 of file World.cpp.

References init(), and pSpace.

Physics::World::World ( const osg::Vec3 &  worldBox  ) 

Same as default constructor, but the main space is a quad space.

Parameters:
worldBox The size of the entire simulated world, centered on (0,0,0) (used to create the main space).

Definition at line 218 of file World.cpp.

References init(), and pSpace.

Physics::World::World ( Space space  ) 

Same as default constructor, with an already allocated Space.

Definition at line 223 of file World.cpp.

References init(), and pSpace.

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.


Member Function Documentation

const JointGroup* Physics::World::getContactGroup (  )  const [inline]

Definition at line 140 of file World.h.

JointGroup* Physics::World::getContactGroup (  )  [inline]

Definition at line 139 of file World.h.

Referenced by Physics::NearCallback::operator()().

const Space* Physics::World::getGlobalSpace (  )  const [inline]

Definition at line 133 of file World.h.

Space* Physics::World::getGlobalSpace (  )  [inline]

Definition at line 132 of file World.h.

const NearCallback* Physics::World::getNearCallback (  )  const [inline]

Definition at line 137 of file World.h.

NearCallback* Physics::World::getNearCallback (  )  [inline]

Definition at line 136 of file World.h.

Referenced by Physics::NearCallback::toPVLENearCallback().

bool Physics::World::getUseQuickStep (  )  const [inline]

Definition at line 115 of file World.h.

void Physics::World::init (  )  [protected]

Physics::World::operator const dWorldID (  )  const [inline]

Definition at line 227 of file World.h.

Physics::World::operator dWorldID (  )  [inline]

Definition at line 226 of file World.h.

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]

Definition at line 135 of file World.h.

void Physics::World::setUseQuickStep ( bool  flag  )  [inline]

Set to true to use a faster but less precise method for step().

Definition at line 114 of file World.h.

void Physics::World::spaceCollide ( Space pCurSpace  )  [protected]

void Physics::World::spaceCollide2 ( AbstractGeom pAGeom1,
AbstractGeom pAGeom2 
) [protected]

void Physics::World::step ( dReal  stepSize  ) 

Perform a full iteration of the physics loop (not just ODE "step").

Todo:
Apply air/water/other friction on bullets (and other things that take into account air friction). Can this be done by colliding with a huge geom that has a "glue"-type physical material ?

Definition at line 252 of file World.cpp.

References bUseQuick, DBG_TRY_BLOCK_END, DBG_TRY_BLOCK_START, pContactGroup, pSpace, resetSpaceCollideFlag(), and spaceCollide().


Friends And Related Function Documentation

friend class Body [friend]

Definition at line 230 of file World.h.

friend class Joint [friend]

Definition at line 231 of file World.h.

friend class JointGroup [friend]

Definition at line 232 of file World.h.

Referenced by init().

friend class NearCallback [friend]

Definition at line 233 of file World.h.


Member Data Documentation

bool Physics::World::bUseQuick [protected]

Definition at line 239 of file World.h.

Referenced by step().

dWorldID Physics::World::id [mutable, protected]

Definition at line 235 of file World.h.

Referenced by Physics::Body::Body().

osg::ref_ptr<JointGroup> Physics::World::pContactGroup [protected]

Definition at line 237 of file World.h.

Referenced by init(), step(), and ~World().

Definition at line 253 of file World.h.

osg::ref_ptr<Space> Physics::World::pSpace [protected]

Main space.

Definition at line 236 of file World.h.

Referenced by step(), World(), and ~World().


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

Generated on Sun Jan 17 11:39:37 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9