thebestneo
thebestneo

Reputation: 137

Time Corrected Verlet Integration and too big timesteps

i use a Time Corrected Verlet Integration found here: http://www.gamedev.net/page/resources/_/technical/math-and-physics/a-simple-time-corrected-verlet-integration-method-r2200

But when my ball is on a wall (horizontal wall, ball upon it and the acceleration is directed down) for a some time, my game cannot recognize the collision in the right way and the ball goes down. If I put a fixed cap to deltatime like 1/60 it seems to work.

I think the problem are too big timesteps. But the time corrected verlet integration is done to avoid too big timesteps, it is right? If yes, why I need the time cap?

Upvotes: 5

Views: 2715

Answers (2)

Aru
Aru

Reputation: 111

The equation given in the article is broken, erroneous. When I derive it, I get this:

x = x + (x – xl)*h/hl + a*h*(h + hl)/2

instead of his, which is this:

x = x + (x – xl)*h/hl + a*h^2

and here's an example using his charts: https://i.sstatic.net/TL6HT.png

Upvotes: 7

Lâm Tran Duy
Lâm Tran Duy

Reputation: 814

From what I understand, the time-corrected verlet integration only helps when you have a fluctuating framerate, but it won't help if your base framerate is too low.

Upvotes: 2

Related Questions