Duality.Components.Physics.RigidBody.RemoveJoint C# (CSharp) Method

RemoveJoint() public method

Removes an existing joint from the Collider.
public RemoveJoint ( Duality.Components.Physics.JointInfo joint ) : void
joint Duality.Components.Physics.JointInfo
return void
        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();
        }