SFML community forums
Help => General => Topic started by: coolhome on July 17, 2009, 04:55:14 am
-
Hello. I got a question that I've ran into in my game development. Lets say we have a object thats 200x100. We set the center to the exact middle and rotate it. Now when we check if the player box intersects with the odd rotating shape how do we do that correctly?
Sinces its rotating sf::IntRect doesn't have a rotate feature.
or am I completey wrong and off track here :P
Thanks,
Preston Alvarado
-
You have to use the separate axis algorithm. It can find intersections between arbitrary polygons, so it may be slightly simpler for two 2D rectangles.
-
Maybe this site helps you:
http://www.metanetsoftware.com/technique/tutorialA.html