Detect intersection without causing bodies to collide

Official forum for the Chipmunk2D Physics Library.
Post Reply
aviran
Posts: 1
Joined: Mon Jun 30, 2014 2:28 am
Contact:

Detect intersection without causing bodies to collide

Post 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.
maximile
Posts: 157
Joined: Mon Aug 20, 2007 12:53 pm
Location: London, UK
Contact:

Re: Detect intersection without causing bodies to collide

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

Who is online

Users browsing this forum: No registered users and 13 guests