# ODE framerate problems

This topic is 4777 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hy! I want use ODE, but I have a problem: when my simulation run at high FPS (~260), the simulation is good, at low FPS (~30) the sumlation crash. I use following stepping: dWorldStep(world,(float)1 / (int)FPS); (I try the dWorldQuickStep, but this doesn't work good, so). I remember can you help! thx. fabo

##### Share on other sites
Welcome to the world of framerate dependant physics. What you need todo is to decouple your physics updates from the actual rendering time choose a fixed timestep and use that, something like this:

    const float step = 0.01f;    static float scrap = 0;    time += scrap;    if(time > 0.5f)	time = 0.5f;    /* Make sure we don't take too big steps. */    for(; time >= step; time -= step)	dWorldStep(m_worldID, step);    scrap = time;

now as long as you can run the physics in real-time (i.e. with 1/step updates/s) everything will behave the same no matter what your fps else things will simply slow down to the maximum speed that the comper can handle.

edit: "time" is the time since the last update 1 / fps in your case

Oh thx!!!!!!!!
It's very good:D
thx

##### Share on other sites
I have new problem: my car's wheel's are rolling false axis. Rear wheels are rolling the vertical axis. I try the dBodySetFiniteRotationMode and dBodySetFiniteRotationAxis, but don't good. The dParamLoStop and the dParamLoStop at the rear wheel's is 0.0. What's the problem?

• 10
• 17
• 9
• 13
• 41