Jump to content
  • Advertisement
Sign in to follow this  
lephyrius

Chipmunk sensors?

This topic is 3133 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!