public void RemoveJoint(JointInfo joint)
{
if (joint == null) throw new ArgumentNullException("joint");
if (joint.BodyA != this && joint.BodyB != this) return;
if (joint.BodyA != null)
{
if (joint.BodyA.joints != null) joint.BodyA.joints.Remove(joint);
joint.BodyA.AwakeBody();
joint.BodyA = null;
}
if (joint.BodyB != null)
{
if (joint.BodyB.joints != null) joint.BodyB.joints.Remove(joint);
joint.BodyB.AwakeBody();
joint.BodyB = null;
}
joint.DestroyJoint();
}