• Advertisement
Sign in to follow this  

Chipmunk sensors?

This topic is 2921 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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).

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement