Page 1 of 1

Strange physics body behaviour at high velocities

Posted: Sun Sep 08, 2019 10:18 pm
by Baggef
When the balls in my project get around 3000-3400 a seemingly random amount of velocity is subtracted. This can range from less than 100 to almost half the velocity, which is very jarring. Is this intended? I doubt I will ever use velocities this high, but it does seem strange that it would do this. If it wanted to keep it below a certain number, clamping the value would make more sense but maybe there's something I'm not getting. If you guys know whats going on please let me know.

Re: Strange physics body behaviour at high velocities

Posted: Mon Sep 09, 2019 3:47 pm
by pgimeno
I've made some simple experiments with dt, and the results suggest that what is clamped is the maximum displacement of the bodies per frame. Because dt is variable, the oscillations of dt are what produces varying velocities.

I've tried with world:update(1/60) and the velocities were clamped at exactly 3600.00. Then with 1/61 and the velocities were clamped at 3720.00. I got some weird results too, because trying with 1/62 also resulted in 3720.00. Visually, the separation was the same in all cases. I haven't tried to measure the exact maximum displacement per frame.