void NewtonUpdate (const NewtonWorld* const newtonWorld, dFloat timestep)
Advances the simulation by an amount of time and waits for step to complete before returning control to your application (Single threaded).
- const NewtonWorld *newtonWorld - pointer to the Newton world
- dFloat timestep - timestep in seconds
This is the heart of the engine. This command updates the entire Newton world, by the amount of time passed (in seconds). This will collect (by calling ForceAndTorqueCallback) and apply any forces to NewtonBodies in the NewtonWorld, detect collisions, and eventually come up with the new positions and orientations for all bodies in the system (and again call the appropriate callbacks).
- Newton only accepts values for elapsed in the following range: 20fps < elapsed < 600fps. if you pass a value outside this range, it will be clamped. For more details see What value should I pass to "NewtonUpdate?
- This function will advance the simulation by the amount of time specified by timestep. The Newton Engine does not perform sub-steps, and does not need tuning parameters. It is the responsibility of the application to ensure that timestep is small enough to guarantee physics stability.
//get elapsed time (depends on your system) float elapsed = System->get_elapsed(); NewtonUpdate( mWorld, elapsed );