void PopFromWorld() { //destroy ODE joints if (RelatedJoints != null) { for (int n = 0; n < RelatedJoints.Count; n++) { ODEPhysicsWorld.Instance.DestroyODEJoint(RelatedJoints[n]); } } DestroyGeomDatas(); if (bodyID != IntPtr.Zero) { Ode.dBodyDestroy(bodyID); bodyID = IntPtr.Zero; } if (bodyData != IntPtr.Zero) { Ode.DestroyBodyData(bodyData); bodyData = IntPtr.Zero; } }