World Class Reference

Physics wrapper. More...

Collaboration diagram for World:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 World (irr::IrrlichtDevice *d)
 ctor
 ~World ()
 dtor
void addObject (Object *o)
 Add an object to the World.
void removeObject (Object *o)
 Remove an object from the World.
void debug ()
 perform a debug drawing of the world
void update (irr::f32 dt)
 Updates the physics world.
bool raycast (const btVector3 &org, btVector3 &dst, btVector3 &ort, btCollisionObject *o=0)
 Raycasting helper function.
bool raycast (const irr::core::vector3df &org, irr::core::vector3df &dst, irr::core::vector3df &ort, btCollisionObject *o=0)
 Raycasting helper function.
irr::IrrlichtDevice * getDevice () const
btDiscreteDynamicsWorld * getDynamicsWorld () const

Static Public Member Functions

static void irrToBullet (const irr::core::matrix4 &m, btTransform &t)
 Convert an Irrlicht matrix into a Bullet transform.
static void bulletToIrr (const btTransform &t, irr::core::matrix4 &m)
 Convert a Bullet transform into an Irrlicht matrix.
static void quaternionToEuler (const btQuaternion &q, btVector3 &e)
 Convert a quaternion into Euler angles.


Detailed Description

Physics wrapper.

The World class manages the Bullet physics engine under the hood to provide advanced collision detection and dynamics in real-time.

To have a physics enabled scene you also need to wrap your scene nodes in Object objects and to register them in the World

See also:
Object

Constructor & Destructor Documentation

World::World ( irr::IrrlichtDevice *  d  ) 

ctor

Parameters:
d Irrlicht device (needed only for the debug drawer)
Initializes the Bullet engine.


Member Function Documentation

void World::debug (  ) 

perform a debug drawing of the world

Note:
This function makes use of Irrlicht video driver and must thus be called between beginScene() and endScene() calls.

void World::update ( irr::f32  dt  ) 

Updates the physics world.

Note:
This function affects the position and rotation of managed (through an Object) scene nodes based on physic consideration (gravity, collision, ...)

References Object::collision().

bool World::raycast ( const btVector3 &  org,
btVector3 &  dst,
btVector3 &  ort,
btCollisionObject *  o = 0 
)

Raycasting helper function.

Note:
if you are using raycast you probably don't need this helper function anyway and ought to use Bullet directly...

Referenced by raycast().

bool World::raycast ( const irr::core::vector3df &  org,
irr::core::vector3df &  dst,
irr::core::vector3df &  ort,
btCollisionObject *  o = 0 
)

Raycasting helper function.

Note:
if you are using raycast you probably don't need this helper function anyway and ought to use Bullet directly...

References raycast().

irr::IrrlichtDevice * World::getDevice (  )  const

Returns:
the Irrlicht device passed to the ctor

Referenced by Camera::event().

btDiscreteDynamicsWorld * World::getDynamicsWorld (  )  const

Returns:
pointer to the internal (Bullet) world
Note:
Using this function is not recommended unless you know what you are doing. It is part of the API only for other physics-related class to use (e.g Object, Camera and Character)

Referenced by Character::Character(), Character::update(), Camera::update(), and Character::~Character().


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

Generated on Sat Jul 26 13:58:39 2008 for TFK:GE by  doxygen 1.5.5