Chipmunk sensors?

Started by
-1 comments, last by lephyrius 14 years, 2 months ago
The problem is that I want sensors for triggers or for collecting "coins" or reaching the goal. So I do this:

if (trigger)
     shape->sensor = 1;

The problem is that when I declare it as a sensor Chipmunk doesn't generate a callback all other code is the same except that line. When I remove that line Chipmunk generates callbacks but it also creates a collision response(the ball bounces back from the coin). This is how I declare callbacks:

cpSpaceSetDefaultCollisionHandler(space,collisionBeginFunc,collisionPreSolveFunc,collisionPostSolveFunc,collisionSeparateFunc,this);

I only call cpSpaceSetDefaultCollisionHandler function once. I use Chipmunk 5.2.0(I also tried with 5.0.0) and Xcode(GCC).

This topic is closed to new replies.

Advertisement