Page 1 of 1

Detect intersection without causing bodies to collide

Posted: Mon Jun 30, 2014 2:29 am
by aviran
I want to detect the intersection of two objects (sprites) in my scene. I don't want the object geometric intersection to cause a collision between the bodies in the scene.

I've created PhysicalBody for both of my object shapes, but I can't find a way to detect the intersection without having both bodies hit each other on impact.

I'm using cocos2d-x 3+ with the default chipmunk engine,

The question is, how do I detect the intersection of elements without having them physically push each other when they intersect.

Re: Detect intersection without causing bodies to collide

Posted: Tue Jul 01, 2014 8:11 am
by maximile
Sounds like you've already got a collision handler callback set up for collisions between those two objects. If you return 0 from the handler, they won't collide but you can still run your own code.