Chipmunk 7. anyway to remove a collision handler?

Discuss new features and future development.

Chipmunk 7. anyway to remove a collision handler?

Postby davecazz » Mon Mar 30, 2015 5:16 pm

Currently trying to migrate to Chipmunk 7 because of 64 bit issues with submitting apps.

Running into an issue trying to migrate called to [ChipmunkSpace removeCollisionHandlerForTypeA: and b:]

as far as I can tell there is no way to remove a handler once it's been added, even in the underlying c class.

the ChipmunkSpace class has a _handlers array that keeps getting bigger with each add call.

looks like the cpSpace class has a hash set so you could theoretically set null functions to the handler but the only way you can reset the hash is to destroy the space.
davecazz
 
Posts: 1
Joined: Fri Mar 27, 2015 5:00 pm

Re: Chipmunk 7. anyway to remove a collision handler?

Postby volte » Sat May 23, 2015 1:48 pm

Bump. I'd like to know the answer to this too. I can't seem to figure it out. I'm gonna dig through the commits. I wish there was an upgrade guide from 6-7.

EDIT: Here is the commit that removes the cpSpaceRemoveCollisionHandler

The commit message simply says "A cleanup/comment pass" so I'm not sure what was behind this API change. I'll keep digging.
volte
 
Posts: 5
Joined: Wed Jun 01, 2011 11:14 pm

Re: Chipmunk 7. anyway to remove a collision handler?

Postby rrakkola » Thu Jul 30, 2015 8:04 am

I would also like to know what is the current way to do this if any?
rrakkola
 
Posts: 9
Joined: Thu Jun 27, 2013 3:04 pm

Re: Chipmunk 7. anyway to remove a collision handler?

Postby p1p1 » Thu Jul 30, 2015 11:35 am

Don't add the body's shape to the cpSpace. Only add bodies, but not shapes. You'll get all the same physics with gravity, etc, but without collisions. Your bodies will jut fly through each other.
p1p1
 
Posts: 7
Joined: Sun Jul 19, 2015 7:17 am


Return to Features/Development

Who is online

Users browsing this forum: No registered users and 1 guest