Collision detection for arbitrary dimensions, positioned and rotated rectangles in XNA
I am working with xna in C # and in my game I will have loads of spaceships flying all over the place. They will each have arbitrary rotation, size and position in space, and I need a method to determine when they collide. Ideally, the method should take two rectangles, two twins, and two Vector2s for size, rotation, and position, respectively, and return a boolean indicating whether or not they intersect.
source to share
Take a look at these links:
An overview of collision detection Collision detection
matrices
Putting collision detection into practice
They show you a way to do pixel-based collision detection that is more accurate than rectangular for irregularly shaped objects.
source to share
You might also consider using this solution without issue and integrating something like the Farseer Physics Engine:
http://farseerphysics.codeplex.com/
source to share