Closed shannon closed 9 years ago
Ignore me I am an idiot. i != items.
I am having trouble with what appears to be bodies still showing up in the list so clearly I have something else going on since this fiddle works fine now.
http://jsfiddle.net/n535chbx/3/
I may reopen if I can pinpoint my problem better.
I figured out my problem. It turns out if I was trying to destroy my body wrapper object instead of the b2Body object.
http://jsfiddle.net/n535chbx/4/
It doesn't error and for some reason it lowers the GetBodyCount(). It lead to some "interesting" results during debugging. I'll just leave my findings here for some other poor soul.
Perhaps there is something I am missing but when I destroy a body and then loop over the world bodies later using GetBodyList they are still all there. But GetBodyCount is the correct number. I created a jsfiddle showing the problem.
http://jsfiddle.net/n535chbx/2/