Code: Select all
- (void)addPostStepRemoval:(id <ChipmunkObject>)obj;
Code: Select all
scheduleToRemoveShape:
Code: Select all
scheduleToRemoveAndFreeShape
Thanks
Code: Select all
- (void)addPostStepRemoval:(id <ChipmunkObject>)obj;
Code: Select all
scheduleToRemoveShape:
Code: Select all
scheduleToRemoveAndFreeShape
For my bodies that only have one shape I have used removeAndFreeShape:(cpShape*);. This takes care of the shape and the associated body, however, when the body has multiple shapes, it doesn't trace back down. My understanding is that a body can have multiple shapes, so the shape knows what body it belongs to, but this call does not check for any other associated shapes.slembcke wrote:The first method you posted addPostStepRemoval: is an Objective-Chipmunk method. Using that you can remove an entire composite physics object with many bodies, joints and shapes in a single call.
SpaceManager wasn't written by me, so I don't really know that much about it. It's not meant to be a full wrapper like Objective-Chipmunk is and it seems to make the assumption that you will only want 1 shape per body. You'll have to use Chipmunk's C API remove the body, it's shapes and manage the memory.
Users browsing this forum: Bing [Bot] and 22 guests