I am trying to figure out how to determine wasthe direction a collision occurs between two Rectanglesrectangles.
One Rectanglerectangle does not move. TheThe other Rectanglerectangle has a velocity in any direction. WhenWhen a collision occurs, I want to be able to set the position of the moving Rectanglerectangle to the point of impact.
I seem to be stuck in determining from what direction the impact occurs. If I am moving strictly Verticallyvertically or Horizontallyhorizontally I manage great detection. But when moving in both directions at the same time, strange things happen.
What is the best way to determine what direction a collision occurs between two rectangles?