Breakable Body Disposal

Aug 30, 2011 at 6:27 PM

Hi,

I cannot figure out to remove the pieces of a breakable body that is broken.  

The bodies are created and work as expected and break apart upon collision, however when I call:

 world.RemoveBreakableBody(s.breakableBody); 

I only get errors after a few calls but no bodies are removed.

 

I use:                     BreakableBody breakableBody = new BreakableBody(vertList, world, 10);  to create.

I have tried iterating the fixture parts and just disposing the MainBody, but I can't figure out what I am doing wrong.

Any suggestions are greatly appreciated.

Thanks,

Scott 

Aug 31, 2011 at 11:45 AM
Edited Aug 31, 2011 at 11:46 AM

Which body? The thing the breaksnle body is that when its broken it spawns the broken parts as new bodies that have the shape of the pieces so yo must prob catch the body adding event and to add logic there.

Of course I might wrong but if you look threw the fixturelidt its empty or something.

Sep 1, 2011 at 2:30 AM

The question is how do I Dispose of the new body/fixture parts?  

Sep 3, 2011 at 11:21 AM
Ok I will try making up an example for you this weekend when I have the time (cause I kinda need that on my project as well hehe) .