If I have a 2D rectangle of type Microsoft.XNA.Framework.Rectangle and I want to see if a point on screen (defined as (x,y)) goes through it after it has also been rotated by a certain amount?
If I have a 2D rectangle of type Microsoft.XNA.Framework.Rectangle and I want to see
Share
Rotate about the origin such that the rectangle is aligned along the X & Y axis, then the test becomes simple:
is rect.left <= point.x <= rect.right, is rect.bottom <= point.y <= rect.topIf you don’t know the rectangle’s rotation, you can figure it out with trigonometry.