Original Post
Im using SAT to test for 2D collisions. But I seem to be getting a lot of errors with my collision responce, where a lot of the time objects are passing through each other instead of the impulse causing them to bounce off each other.
I believe this is due to my SAT implementation. Ive noticed that Im not paying attention to which direction on the found axis with the smallest penetration im going to use as the collision normal.
For example, if i have 2 squares colliding, there is 4 axies, square ones x and y, and square twos x and y. However, this four axies can also be positive or negative.
When you've found the axis with the smallest penetration, how do you determine whether to use this axis in the positive direction or the negative direction?
i.e, if black is the axis with the smallest penetration, is the contact normal the red or the blue direction?

I assume Im also going to need to take into consideration the objects velocities. So I'd project A's velocity onto the axis, and get the direction thats most opposite to A's velocity?
I believe this is due to my SAT implementation. Ive noticed that Im not paying attention to which direction on the found axis with the smallest penetration im going to use as the collision normal.
For example, if i have 2 squares colliding, there is 4 axies, square ones x and y, and square twos x and y. However, this four axies can also be positive or negative.
When you've found the axis with the smallest penetration, how do you determine whether to use this axis in the positive direction or the negative direction?
i.e, if black is the axis with the smallest penetration, is the contact normal the red or the blue direction?

I assume Im also going to need to take into consideration the objects velocities. So I'd project A's velocity onto the axis, and get the direction thats most opposite to A's velocity?