This project has moved and is read-only. For the latest updates, please go here.

PointInPolygon and rotation?

Topics: Developer Forum
Jan 22, 2011 at 1:02 AM


I'm using Farseer 3.2 and I'm trying to find a way to see if a given point is located inside a polygon.

I already found the Vertices.PointInPolygon method but it doesn't seem to work with rotated polygons.

What's the correct way to do this?

Thanks for your help!

Jan 22, 2011 at 1:07 AM

Well PointInPolygon method should work assuming your using the rotated points. If you don't want to rotate all the points of the polygon then you can just rotate the point you are testing the opposite way and then test.

If you can post up exactly how your trying to find whether the point is in the polygon I can help better.

Jan 22, 2011 at 12:18 PM

I found the solution, I simply was using the wrong method. Fixture.TestPoint does exactly what I want.

Thanks anyway for the fast response!