Turn off static -> sprite collisions

Official forum for the Chipmunk2D Physics Library.
Post Reply
Droid_999
Posts: 9
Joined: Sat Nov 03, 2012 5:04 pm
Contact:

Turn off static -> sprite collisions

Post by Droid_999 »

Howdy

I have implemented Chipmunk into my top down scroller, and collision detection between the player and static line segments is working very well. But, as part of debugging, sometimes I need to disable the collision on the fly - is there a 'switch' that allows disabling and re-enabling collisions between shapes and static line segments?

Thanks
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

Re: Turn off static -> sprite collisions

Post by slembcke »

The easiest thing to do would be to the categories/mask feature (Chipmunk 7) or the layers feature (Chipmunk 6). If you zero all of the bits out on your player, then it won't collide with anything. Then you just need to restore the values when you are done.
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
Post Reply

Who is online

Users browsing this forum: Metager [Bot] and 15 guests