Rogue body and collision detection

Discuss new features and future development.

Rogue body and collision detection

Postby kandkstuart » Sat Nov 17, 2012 7:40 pm

I need to use rogue bodies to move objects I don't want controlled by chipmunk but I need to have collision detection possible with the rogue bodies. Is this possible? And if so how would one accomplish it if the rogue bodies are part of the space?

Thanks for any help!
kandkstuart
 
Posts: 29
Joined: Thu Jan 12, 2012 10:08 pm

Re: Rogue body and collision detection

Postby slembcke » Sat Nov 17, 2012 10:35 pm

When you say "collision detection" which do you mean? That callbacks should be called or that there should be a collision response?

Collisions are not detected at all between infinite mass objects (so no callbacks or response). If you changed it so that it did you would have to make sure to return false from the the begin or preSolve callbacks to avoid an unsolvable collision. Working with finite mass rogue bodies is not really recommended. You'd really have to know what you are doing.

Collisions between infinite mass and finite mass bodies (rogue or otherwise) works normally.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Rogue body and collision detection

Postby kandkstuart » Sun Nov 18, 2012 7:25 am

I guess I'm trying to figure out the best way to move an object myself but use chipmunks collision detection for that object. I have a pathfinding AI that moves my enemy objects so I don't need chipmunk to do that work but I would like chipmunk to detect when the enemy objects collide with other objects. What would you suggest? Things I have tried haven't been successful.
kandkstuart
 
Posts: 29
Joined: Thu Jan 12, 2012 10:08 pm

Re: Rogue body and collision detection

Postby slembcke » Mon Nov 19, 2012 1:00 pm

Hmm. It sounds like maybe you just want sensor shapes?
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Rogue body and collision detection

Postby kandkstuart » Mon Nov 19, 2012 6:42 pm

Do you have a link to an example of sensor shapes somewhere?
kandkstuart
 
Posts: 29
Joined: Thu Jan 12, 2012 10:08 pm

Re: Rogue body and collision detection

Postby kandkstuart » Mon Nov 19, 2012 8:56 pm

I see you just set a flag. By setting the Sensor flag that shape can be moved manually without impact from Chipmunks perspective? Oh ya, will chipmunk detect a collision between the same object if given a callback routine?
kandkstuart
 
Posts: 29
Joined: Thu Jan 12, 2012 10:08 pm

Re: Rogue body and collision detection

Postby slembcke » Tue Nov 20, 2012 2:42 am

Yep, sensors are for collision shapes where you want callbacks but no collision response. Basically the same as if you returned false for the preSolve callback each time.

One problem that I noticed a day or two ago is that collisions between infinite mass objects is filtered out before even calling the callbacks. So don't make infinite mass sensor objects. I intend to change it to work like sensors instead though.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: Rogue body and collision detection

Postby kandkstuart » Tue Nov 20, 2012 6:02 am

that does the trick! Thanks as always!
kandkstuart
 
Posts: 29
Joined: Thu Jan 12, 2012 10:08 pm


Return to Features/Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron