Picking

Official forum for the Chipmunk2D Physics Library.
Pipo
Posts: 13
Joined: Thu Jan 03, 2008 11:27 am
Contact:

Re: Picking

Post by Pipo »

mcc => you have to download the last source from aerosol's svn (http://code.google.com/p/aerosol/source/checkout)
jim
Posts: 6
Joined: Fri Mar 14, 2008 6:44 am
Contact:

Re: Picking

Post by jim »

Picking seems to work well so far :D
My problem is that there is no obvious means of it telling you that no shape was picked, i.e. so that i can tell a shape no longer has focus.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Picking

Post by slembcke »

jim wrote:Picking seems to work well so far :D
My problem is that there is no obvious means of it telling you that no shape was picked, i.e. so that i can tell a shape no longer has focus.
Well you have a few options depending on how fancy you want to get. You could save only the last object passed to the callback (if you only want one/none). You could make a list of the objects in the callback (if you want many/none). If you want to get real fancy, you could use setjmp/longjmp to break out of the callback loop on the first object returned.

A better solution would be not to use C. ;)
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
jim
Posts: 6
Joined: Fri Mar 14, 2008 6:44 am
Contact:

Re: Picking

Post by jim »

I made SPACE_PointQuery return a boolean indicating if a shape was picked, fairly straight forward.

Cheers,
Jim
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests