How would I find out if any points of a given Rectangle are inside a Polygon?
I have tried:
final Point p = new Point(rect.x, rect.y);
return polygon.contains(p);
This half works. It only returns true when the top left corner of the rectangle is in the polygon (Yes, I do know why).
Is there a way to check if ANY of the points of the rectangle are in the polygon?
Thanks in advance!
I have found the best way to do this:
return polygon.intersects(rect);