   2d sprite collision with rotation
  Im working on a 2d collision detection algorithm for my sprite engine. I've done this in the past with bounding rectangles, but that wont work with rotated sprites. For example, If the sun were in the center of the screen with the Earth rotating around it, my collision detection would always think the Earth is right above the sun because it does not account for rotation. My detection function accepts two custom jSprite classes, which hold information for all the transformations such as radians of rotation and rotation center point. How can I account for these transformations for detecting collisions?   
Quote:Original post by ChainChiefIm working on a 2d collision detection algorithm for my sprite engine. I've done this in the past with bounding rectangles, but that wont work with rotated sprites. For example, If the sun were in the center of the screen with the Earth rotating around it, my collision detection would always think the Earth is right above the sun because it does not account for rotation. My detection function accepts two custom jSprite classes, which hold information for all the transformations such as radians of rotation and rotation center point. How can I account for these transformations for detecting collisions?First, specify what language and API are you using otherwise giving code example is pretty much useless. Anyway in DirectX the bounding rectangles aren't actually the best way to manage cause they have "problems" with rotations and such. I suggest switching to the use of bounding spheres and make them take account of the trasformation matrix you are applying to the object.   ;  I am using visual c++ 2008 with DirectX. The bounding spheres sounds like it would work well for my engine, but I am not sure how to set this up to take into account the transformations. Can someone send me a link to an explanation of this?   