by atis on Fri Jan 29, 2010 8:26 pm
Well, forget the destroying part.
Should it be so that a collision callback is invoked for shape that has been removed from space? I mean, the callbacks are not called for shapes that haven't been added to it, and (it seems to me) every other type of callback, except separate, will not be called if any of the shapes involved have been removed from space.
So it just seems a bit unexpected and counter-intuitive.
I would propose that during cpSpaceRemoveShape(), any references to the removed shape within the space are found, and the arbiters containing them removed; or alternatively, the shape pointer within arbiters could be set to NULL. Ok, I'm not too familiar with Chipmunk internals, so maybe that's hard to do. It's just that, in my mind, it seems like the logical thing to do.