Changes

Jump to: navigation, search

Team Guardian Physics

740 bytes added, 01:47, 6 April 2011
PhysicsScene
The standard controller functions should be called in the usual places in Engine.cpp (Delete(), release(), suspend(), reset(), restore()), please refer to Engine.cpp in the reference implementation for more details.
In order to advance the simulation forward, <code>update(int now)</code> should be called every frame. Naturally, PhysicsScene's <code>update()</code> should be called from within <code>Engine</code>'s run. Physics should be updated before design is updated. Let's look at how this is accomplished in the reference implementation: <pre>now = rightNow; // retrieve user input, if anykeyboard->retrieveInput();mouse->retrieveInput();joystick->retrieveInput(); // updatethe model componentsphysicsScene->update(rightNow);design->update(rightNow);scene->updateEmitters(rightNow);viewing->update(rightNow);audio->update(rightNow);lighting->update();hud->update(rightNow);</pre> This is sufficient to add physics simulation support to Chris' framework. This won't magically cause your objects to suddenly start moving around and reacting to gravity however. To do that, each object that should be simulated by the simulator must be associated with a RigidBody.
== Integrating Framework Into Existing Projects ==

Navigation menu