schteppe/cannon.js — pull request #68 by trendkillgaming (2013-03-31 17:06:26+00:00)
Title: world.remove now queues bodies for deletion

As discussed in issue #67

Your suggestion of saving the bodies to be removed, then removing them after the step() worked perfectly.

>I guess this mechanism could be integrated into the engine, would that make sense? Or perhaps it should throw an error message when trying to remove a body during step()?

Here is a proposed implementation of your suggestion plus a demo, it makes sense to me to have this integrated as there are many situations I can think of where removing a body from within a callback would be useful.