I have a rectangle that has a sprite’s initial position and bound and it looks like this- boundRectangle(position.x, position.y, width, height)
Now that sprite always rotates (it’s a laser beam), and I want to use this rectangle to detect collisions with other objects (and for this it needs to rotate accordingly), so i guess the question is quiet obvious by now -how do I rotate that rectangle to match the sprite actual rotation? (given of course that I have the sprite’s rotation angle and point of origin)
Maybe this similar thread will help you: Collision detection with rotating crosses (or similar)
Recangles can’t be rotated, but you can calculate where your point would be after rotation and use those points for collision.
it didn’t helped… but thanks anywhy…
by the way, if anyone is interested, i believe that i managed to get it working by using the sample attached and reading the comments here -> http://geekswithblogs.net/clingermangw/archive/2010/01/09/137402.aspx