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. |
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
World::World | ( | irr::IrrlichtDevice * | d | ) |
ctor
d | Irrlicht device (needed only for the debug drawer) |
void World::debug | ( | ) |
perform a debug drawing of the world
void World::update | ( | irr::f32 | dt | ) |
Updates the physics world.
References Object::collision().
bool World::raycast | ( | const btVector3 & | org, | |
btVector3 & | dst, | |||
btVector3 & | ort, | |||
btCollisionObject * | o = 0 | |||
) |
Raycasting helper function.
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.
References raycast().
irr::IrrlichtDevice * World::getDevice | ( | ) | const |
btDiscreteDynamicsWorld * World::getDynamicsWorld | ( | ) | const |
Referenced by Character::Character(), Character::update(), Camera::update(), and Character::~Character().