hey there
i am using chipmunk for an iphone puzzle game, works great. i am a bit stuck though, i have a bunch of active shapes and i need to detect if they are all within a non-convex polygonal region defined by a bunch of vertices. what would be the easiest way to achieve this?
detect if shapes are contained within non convex region
-
- Posts: 2
- Joined: Fri Mar 05, 2010 5:06 am
- Contact:
-
- Posts: 2
- Joined: Fri Mar 05, 2010 5:06 am
- Contact:
Re: detect if shapes are contained within non convex region
was quite easy in the end, if anyone has the same problem, i used this:
http://www.ecse.rpi.edu/Homepages/wrf/R ... npoly.html
and first checked if the bounding boxes for each shape were in the bounding box of the goal region, if so then check if each shape vertex is contained in the goal region using the above algorithm.
http://www.ecse.rpi.edu/Homepages/wrf/R ... npoly.html
and first checked if the bounding boxes for each shape were in the bounding box of the goal region, if so then check if each shape vertex is contained in the goal region using the above algorithm.
Who is online
Users browsing this forum: Bing [Bot] and 32 guests