I'm working on a little spaceship dogfighting game, but I've reached the point in developing my collision code that I need to figure out what side of a rectangular object I'm colliding with in order to set the normal vector so ships (and potentially other objects) can bounce off at the correct angles. This code needs to work with the target object (oWall) rotated and scaled. Presently I can set the normal so the player ship bounces off the top and bottom of the wall object OR the sides, but as it stands I can't have both unless I can on the fly toggle the normal vector based on what side of the wall the ship is hitting.
Any help, suggestions, resources, etc, would be appreciated.