Question about destruction of bodies

Topics: Developer Forum
Apr 8, 2009 at 12:38 AM
Well i am reworking how one of the implementation details of one of my main features works, and i need to know if when you toast a body (remove it from the engine etc.) does all of the joints that are attached to it go away too or do i need to manually call Dispose on them?
Apr 8, 2009 at 2:43 AM
I don't know the answer to that, but I could open the PhysicsSimulatorView on one of the demos and remove a body and find out for you pretty easily.  Have you tried that already?
Apr 8, 2009 at 4:11 AM
Nope... i'm not sure what would be the proper spot to insert a call to RemoveBody. I might experiment with it later...
Apr 8, 2009 at 2:00 PM
Joints and Springs are able to remove themselves if their attached body is disposed. All the dynamics of the engine have a Validate() method that gets called on all joints/springs right after the engine processed the removed/disposed geometries and bodies.
Apr 9, 2009 at 2:04 AM
Thanks... that makes my life much easier i think... Other wise i was going to have to sort through a list of joints and nuke the proper ones (hard since the list isnt sorted).