0

I'll keep the question short.

I'm making a 2D game.

I have an object, but since it has many pieces, I just out it in a box to have it's hitbox.

If it's going up/down/left/right at perfect angles, I can check for collision because it's just about the left corner and then height and width.

How do I calculate if my mouseX and mouseY collide with it if it rotates at different angles.

Found a formula that x' = x sin A - y cos A or something, but didn't work.

Thank you!

  • 1
    Does this help answer your question? https://stackoverflow.com/questions/14629983/algorithms-for-collision-detection-between-arbitrarily-sized-convex-polygons – James Williams Nov 12 '22 at 09:59

0 Answers0