Probably a really easy question for you season pros, but I can't seem to think of an obvious solution to this problem.
Here it is in a simple form:
Imagine a rectangle travelling horizontally, it collides with another rectangle that is above it, overlapping it only slightly from above:
_____
___ | |
| | |-------|
| |
| | ----->
|___|_______________
This will result in the object being pushed down into the floor (the penetration in the downward direction may be the smallest) which will lead to it being pushed back up by the floor.
How do you avoid this problem and ensure that the object stops dead on collision rather than gets pushed down.
I though about separating the collision into stages, testing only one axis at a time but that feels clunky.
Hold the phones, whilst writing this I think maybe I should never check the bottom side of the top body because its normal (if dotted with the direction of the other body) would show that they should never be tested against each other.
Maybe that is more important than I though, never check a face if its normal dot the direction is greater than 0? Am I on the right lines? Am only really dabbling here so not the end of the world if I can work it out. Thanks for your time.