#include <world.h>
Public Member Functions | |
| World (float timestep=Globals::DEFAULT_TIMESTEP, BroadPhase< d > *broadphase=0, ContactGenerator< d > *contactGenerator=0, ContactList< d > *contactList=0, ContactResolver< d > *velocityResolver=0, ContactResolver< d > *positionResolver=0) | |
| ~World () | |
| void | add (Body *body) |
| void | remove (Body *body) |
| body_iterator | remove (body_iterator it) |
| void | add (Shape *shape) |
| void | add (Joint *joint) |
| void | remove (Joint *joint) |
| void | add (ForceGenerator *generator) |
| void | remove (ForceGenerator *generator) |
| void | step () |
| std::list< Body * > | findBeneathAll (const Vector &position) |
| std::list< Body * > | findBeneathAll (const AARect &rect) const |
| Body * | findBeneath (const Vector &position) const |
| Body * | findBeneath (const AARect &rect) |
| Body * | intersectRay (const Vector &start, const Vector &dir, Vector &p) const |
| Body * | intersectRay (const Vector &start, const Vector &dir) const |
| World::World | ( | float | timestep = Globals::DEFAULT_TIMESTEP, |
|
| BroadPhase< d > * | broadphase = 0, |
|||
| ContactGenerator< d > * | contactGenerator = 0, |
|||
| ContactList< d > * | contactList = 0, |
|||
| ContactResolver< d > * | velocityResolver = 0, |
|||
| ContactResolver< d > * | positionResolver = 0 | |||
| ) | [inline] |
You can pass in 0 to any of these parameters to use the default algorithm, or provide a specific implementation you want to use.
| World::~World | ( | ) | [inline] |
Deletes everything in this world. If there is something you don't want to be deleted, you should remove it from the world first.
| void World::add | ( | Body * | body | ) | [inline] |
Add a body to the world. Note: this cannot be safely called from within a loop iterating over the bodies container.
| void World::remove | ( | Body * | body | ) | [inline] |
Remove this body from the world. Note: this cannot be safely called from within a loop iterating over the bodies container. You should use remove(World::body_iterator) instead.
| World< d >::body_iterator World::remove | ( | body_iterator | it | ) | [inline] |
Remove a body from the world given an iterator to that body. Returns an iterator to the next body in the container.
| void World::add | ( | Shape * | shape | ) | [inline] |
Add a static body to the world with this shape.
| void World::add | ( | Joint * | joint | ) | [inline] |
Add a joint to the world.
| void World::remove | ( | Joint * | joint | ) | [inline] |
Remove a joint from the world.
| void World::add | ( | ForceGenerator * | generator | ) | [inline] |
Add a force generator to the world.
| void World::remove | ( | ForceGenerator * | generator | ) | [inline] |
Remove a force generator from the world.
| void World::step | ( | ) | [inline] |
Simulate one frame.
| std::list<Body*> physics::World< d >::findBeneathAll | ( | const Vector & | position | ) |
Find all bodies located at this position (if any).
| std::list< typename d::Body * > World::findBeneathAll | ( | const AARect & | rect | ) | const [inline] |
Find all bodies touching this rect.
| d::Body * World::findBeneath | ( | const Vector & | position | ) | const [inline] |
Find the first body located at this position (if any).
| Body* physics::World< d >::findBeneath | ( | const AARect & | rect | ) |
Find the first body touching this rect
| d::Body * World::intersectRay | ( | const Vector & | start, | |
| const Vector & | dir, | |||
| Vector & | p | |||
| ) | const [inline] |
Intersect a ray with the world and return the first Body it hits
| start | Origin of the ray. | |
| dir | Direction of the ray. | |
| p | Set by reference to the intersection point found. |
| d::Body * World::intersectRay | ( | const Vector & | start, | |
| const Vector & | dir | |||
| ) | const [inline] |
Intersect a ray with the world and return the first Body it hits
| start | Origin of the ray. | |
| dir | Direction of the ray. |
1.5.6