Inside of the Update function, if 2 bodies collide I want to remove them (or mark them as needing to be removed, and remove them at the end of the time step). How would I accomplish this?
In the Update function I try
var bodyA = this.m_fixtureA.m_body;
...
bodyA.m_world.DestroyBody(bodyA);
However, they don't get deleted. It seems that when I am trying to delete them, this.IsLocked() is set to true.