[ODE] rate for fixed timesteps

Remko Jacobs (act-3d.com) Remko at act-3d.com
Thu Nov 14 04:00:02 2002


Using a fixed time step is the way to go. The problem is that the frame   
rate is not constant. We solved this by using a constant update rate (in   
Hz) for ODE that is independent of the program updates.

CFM and ERP values work differently with different time steps so you   
should avoid using more than one different time step for one project.

Using a constant update frequency means that for some frames there might   
be 10 time steps calculated for ODE and other frames ODE does not update   
at all.

From: David McClurg [mailto:dmcclurg@pandemicstudios.com.au]
    

>To avoid breaking through geometry or generating large collision   
>penetration depths, you'll need use a step value which scales to your   
>velocity.
>
>  step = 1/60
>  speed = length(vel)
>  if (speed * step) > max_depth then
>    step = max_depth / speed
>  endif
>  dWorldStep(world, step)
>
>just make sure max_depth is less than the radius of your moving vehicle.   
>ideally, it would be small enough not to visually notice either (eg.   
radius * 0.1f)
>if you really want to use a fixed time step,
>
>  step = max_depth / max_speed