Esempio n. 1
0
 public void ForceDetach()
 {
     for (int i = 0; i < bonesCount; i++)
     {
         RagdollPhysics.DetachRigidbody(allElements[i].rigidbody, null, true);
     }
 }
Esempio n. 2
0
 public void Detach()
 {
     grabPoint.Detach();
     for (int x = 0; x < physicsHit.hitElements.Count; x++)
     {
         RagdollPhysics.DetachRigidbody(physicsHit.hitElements[x].rigidbody, connectedJoints[x], false);
     }
     connectedJoints.Clear();
 }
Esempio n. 3
0
 public static void ReleaseGrabPoint(GrabPoint grabPoint)
 {
     if (grabPoint != null)
     {
         RagdollPhysics.DetachRigidbody(grabPoint.baseRigidbody, null, true);
         ReesetGrabPoint(grabPoint);
         grabPoint.gameObject.SetActive(false);
     }
 }
Esempio n. 4
0
        static void ReesetGrabPoint(GrabPoint p)
        {
            // detach our grab point, if it was attached at all
            RagdollPhysics.DetachRigidbody(p.baseRigidbody, null, true);

            p.baseRigidbody.isKinematic = true;
            p.baseRigidbody.useGravity  = false;

            p.childRigidbody.transform.SetParent(p.baseRigidbody.transform);
            p.childRigidbody.transform.localPosition = Vector3.zero;
            p.childRigidbody.transform.localRotation = Quaternion.identity;

            RagdollPhysics.MakeJointDefault(p.baseJoint, freeRotation: false, Vector3.zero, Vector3.zero, p.baseRigidbody);
        }
Esempio n. 5
0
 public void Detach()
 {
     RagdollPhysics.DetachRigidbody(baseRigidbody, null, true);
     ReesetGrabPoint(this);
     gameObject.SetActive(false);
 }