detect if shapes are contained within non convex region

Official forum for the Chipmunk2D Physics Library.
Post Reply
kreuters
Posts: 2
Joined: Fri Mar 05, 2010 5:06 am
Contact:

detect if shapes are contained within non convex region

Post by kreuters »

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?
kreuters
Posts: 2
Joined: Fri Mar 05, 2010 5:06 am
Contact:

Re: detect if shapes are contained within non convex region

Post by kreuters »

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.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 32 guests