Sprite system physics demo released!

BlitzMax Forums/BlitzMax Programming/Sprite system physics demo released!


Ugh, I'm trying to solve this stupid interpenetration issue, and nothing I try works, even moving the objects back to where they were in the frame before they overlapped! They just end up sticking together and it's worse than before! I've tried moving them back, applying a force equal to the force that brought them together in reverse, doing both of those at the same time, and even calculating whether the objects are moving towards or away from eachother so I can do nothing if they are already moving away! Argh!



Sounds like a tunneling problem :). That stuff's always a bit tricky to deal with correctly. I haven't had a chance to take a look at the demo yet, but I do know if you are waiting to do collision response AFTER objects overlap you will have issues trying to get rid of tunneling.
With the 2-D physics we're implementing we detect collisions before the objects physically touch, therefore you are never in the situation of one object penetrating another.

my best advice would be to determine the actual position of both objects when they FIRST hit each other (this is not the first frame you see them overlap either) and do collision response from those two positions.