[ODE] interactive and continuous physics collisions?
Bram Stolk
b.stolk at gmail.com
Fri Aug 24 07:57:49 MST 2007
Hi,
Easiest way:
Just take smaller time steps through your simulation.
Your simulations/sec can be more than visualizations/sec.
With the code below, the sim will be at 100Hz, even if your
viz frame rate drops to say 30 Hz.
FOR EACH VIZ FRAME:
CALCULATE ELAPSED TIME dt
float timestep=0.010; // Use 10ms timesteps
static float remaining_sim_time=0;
remaining_sim_time += dt;
while (remaining_sim_time > timestep)
{
dSpaceCollide (bigspace, 0, &near_callback);
dWorldQuickStep (world, timestep);
dJointGroupEmpty (contactgroup);
remaining_sim_time -= timestep;
}
//
RENDER FRAME
More info at:
http://opende.sourceforge.net/wiki/index.php/HOWTO_integrate_simulation_and_visualization
Bram
More information about the ODE
mailing list