Archived

This topic is now archived and is closed to further replies.

Stepping through time...

This topic is 5311 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

Hi. Most physicsimulations out there advance through the simulation by small steps.(ODE for example) What is the best way to make a loop that makes sure the physics runs smooth and at a constant and realistic rate. What should the stepsize be and must I lock the framerate(Framelimiting) to achieve this? And is framelimiting a good idea?, wouldn''t that be a "waste of pace"(oh, that one was bad) for fast computers? I would be very thankful if someone could show me or point me to a place there I could see a codesnippet of a "correct" "physics loop". //Sweenie

Share this post


Link to post
Share on other sites
Get the delay wich past from the last physics done until now
and use it as timedelay in the physic-simulation, maybe multiply it with a factor so thats looking realistic.
This way you get a good looking physics wich becomes more exact with higher framerates.
Another good thing is to calculate the time delay like 1/delay if the delay is above a certain value you than have to multiply it with a value so that the timedelay at the bordering delaytime is the same value as short above, this way the simulation is getting very slow but still smooth if the framerate drops.

Share this post


Link to post
Share on other sites