Im doing collision detection in a game. All the surfaces are orthagonal so I only need to determine which face of an obstacle my moving object has collided with. I have the rectangle defining the intersection of the two objects and the vector representing the moving objects speed and direction of movement.
I reckon I need to translate the intersection rectangle along my moving objects vector until the intersection becomes a line, then I'll know which face was collided with 1st.
I have no idea how to do this mathematically of programatically however
Actually I may have figured it out...
Find the point on the intersection rectangle that isnt on the objects rectangle
draw a line from there in the vectors direction