/** Destroy a rigid body given a definition. No reference to the definition is retained. This function is locked during
* callbacks.
* @warning This automatically deletes all associated shapes and joints.
* @warning This function is locked during callbacks. */
public void destroyBody (Body body) {
JointEdge jointEdge = body.body.getJointList();
while (jointEdge != null) {
world.destroyJoint(jointEdge.joint);
joints.remove(jointEdge.joint);
jointEdge = jointEdge.next;
}