Jump to content
  • Advertisement
Sign in to follow this  
fabo

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!