[Odejava] Frame rate independance

Hi,
how is this achieved in ODE? because im calling:

world.setStepSize(timerPerFrame); which I am doing in order to maintain frame independance. However, that comes at a great cost. Because the float is not a constant, you always get this “random” factor every time you run the program. Which I feel that I should not be calling setStepSize every frame…

So how does ODE do it, does it have its own timer? Or is there a method I should call?

Thx

You are not meant to change the step size too frequently as ODE makes many assumptions based on the step size so changing it introduces error (as you have seen). There are solutions but I am not the best person to tell you about them (being that I am also in need of one). I suggest checking the ODE mailing list archives or ask a question on the list.

Will.

all the solutions that I have seen refer to limiting the FPS. And then having a set StepSize…

Btw, ive also found out that ODE gives a more realistic simulation when the interpolation between frames is doubled…

Is there a logical explanation for this?

for the frame rate independance thing. i have found a good solution.

The person limits the calls to step() to a set number in a frame…e.g. 100. Then setting the stepsize to be 2/100 (because 1/100 doesn’t seem to give a good simulation, so doubling it is pretty good!).

This gives me frame rate independance, so I can go about my usual business without having to limit the FPS…

Hope this is useful for someone cause it took me quite a while to come up with this simple solution :slight_smile:

DP

What would happen if you make the game frame rate independent and give ode the average step size every now and then.

This is what we are currently doing but I dont want to restrict the user to use FixedFramerateGame or FixedLogicrateGame.

This is the only real solution i could come up with.

DP