Strange physics body behaviour at high velocities

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Baggef
Prole
Posts: 20
Joined: Fri Aug 23, 2019 7:30 pm
Location: USA
Contact:

Strange physics body behaviour at high velocities

Post 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.
Attachments
physicsTest.love
(2.94 KiB) Downloaded 135 times
gaeem defelpmint is maiy pashin
Itch: Freakman
User avatar
pgimeno
Party member
Posts: 3689
Joined: Sun Oct 18, 2015 2:58 pm

Re: Strange physics body behaviour at high velocities

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests