As my bodies are colliding fine, I move the window by dragging the title bar, This seems to pause the graphics rendering, But upon stopping the drag, The physics seem to display awkward behaviour as if it had continued simulating the physics whilst i was dragging, but it had failed to do collisions as such.
I would like to elaborate more but i was hoping maybe somebody had already experienced this before and could maybe post a solution because i couldnt find anything via search
I had the same problem,
and for any reason it seems that the position of the physical objects are related to the screen itself instead of related to the current window, When I was doing my water simulation I saw that behavior like shaking the objects around when dragging the window
When you drag the window, everything stops except the timer. When you release the window, a lot of time may have passed since last frame, and so the timestep supplied to World:update(dt) is possible huge.
athanazio wrote:the physical objects are related to the screen itself
Haha, I certainly hope that is not the case.
I remember looking into this some years ago, and I think I found out that SDL has no way of detecting when windows are being moved (but please prove me wrong). The only solution available now is to not drag the window and/or use love.system.grabInput(true) to restrict the mouse to the window area.
maxdt = 1 --1 second, maybe, experiment with this
function update(dt)
while dt > 0 then
local tempdt = dt --you should rename this to something more useful, but for the sake of examples
if tempdt > maxdt then tempdt = maxdt end
--do your update stuff with tempdt instead of dt
end
end
@rude: I did find a page where they said 'video expose' events are sent during dragging (and after) and (of course) active events (because mouse leaves and enters) surrounding those. Here it is