Hi there
I'm implementing my own game from scratch, and for physics I've been reading the book by Ian Millington “Game Physics Engine Development”
I do my own variation and some things are built differently, but the core of the collision resolution is like Ians. Currently I have implemented collision resolution up until the friction part (meaning no friction yet). And some parts of the engine are not working as intended. I'll show a couple of videos.
Currently I only check for collisions between one OBB (the figure) and the AABBs (static environment). I clip the vertices of the OBB that penetrate through the planes of the AABBs and use them as contactpoints, collect them all in an array alongside their specific penetrations and the overall contact normal for the collision. This gives me 1-4 contact points, 1-4 penetrations, 1 normal for each of my collisions.
I think the penetrationresolution works as in intended. (The white line is min→max point of the OBB)
Just a quick note: On the first video i kinda “push” the object by applying force to it - resulting in the object moving about. I do the same on the second video, but the bouncing/initial rotation and everything else is not coming from me
But when i try to apply correctional velocity, everything starts bouncing and behaving weirdly.
I've walked through the code so many times now and tested a lot of different things out - but can't seem to figure out why this is happening. Any ideas would be highly appreciated!