Пример #1
0
 void FixedUpdate()
 {
     if (!GetComponent <Rigidbody>().isKinematic)
     {
         drive.Update();
     }
 }
Пример #2
0
    void FixedUpdate()
    {
        if (GetComponent <HingeJoint>().connectedBody.GetComponent <Rigidbody>().isKinematic)
        {
            float angle0delta = Mathf.Sign(kinematicrestdeltaangle0) * Time.deltaTime * rotatingplatformkinematicangularvelocity;
            float angle1delta = Mathf.Sign(kinematicrestdeltaangle1) * Time.deltaTime * leverkinematicangularvelocity;
            float angle2delta = Mathf.Sign(kinematicrestdeltaangle2) * Time.deltaTime * armkinematicangularvelocity;

            angle0delta = Mathf.Sign(kinematicrestdeltaangle0) == Mathf.Sign(kinematicrestdeltaangle0 - angle0delta) ? angle0delta : kinematicrestdeltaangle0;
            angle1delta = Mathf.Sign(kinematicrestdeltaangle1) == Mathf.Sign(kinematicrestdeltaangle1 - angle1delta) ? angle1delta : kinematicrestdeltaangle1;
            angle2delta = Mathf.Sign(kinematicrestdeltaangle2) == Mathf.Sign(kinematicrestdeltaangle2 - angle2delta) ? angle2delta : kinematicrestdeltaangle2;

            kinematicrestdeltaangle0 -= angle0delta;
            kinematicrestdeltaangle1 -= angle1delta;
            kinematicrestdeltaangle2 -= angle2delta;

            Kinematic(angle0delta, angle1delta, angle2delta);
        }
        else
        {
            drive.Update();
        }

        capture.KinematicUpdate();
        for (int i = 0; i < fingers.Count; i++)
        {
            fingers[i].KinematicUpdate();
        }
        if (thing != null)
        {
            thing.KinematicUpdate();
        }
    }
Пример #3
0
    void FixedUpdate()
    {
        if (GetComponent <HingeJoint>().connectedBody.GetComponent <Rigidbody>().isKinematic)
        {
            float angle0delta = Mathf.Sign(kinematicrestdeltaangle0) * Time.deltaTime * kinematicangularvelocity;
            float angle1delta = Mathf.Sign(kinematicrestdeltaangle1) * Time.deltaTime * kinematicangularvelocity;
            float angle2delta = Mathf.Sign(kinematicrestdeltaangle2) * Time.deltaTime * kinematicangularvelocity;

            angle0delta = Mathf.Sign(kinematicrestdeltaangle0) == Mathf.Sign(kinematicrestdeltaangle0 - angle0delta) ? angle0delta : kinematicrestdeltaangle0;
            angle1delta = Mathf.Sign(kinematicrestdeltaangle1) == Mathf.Sign(kinematicrestdeltaangle1 - angle1delta) ? angle1delta : kinematicrestdeltaangle1;
            angle2delta = Mathf.Sign(kinematicrestdeltaangle2) == Mathf.Sign(kinematicrestdeltaangle2 - angle2delta) ? angle2delta : kinematicrestdeltaangle2;

            kinematicrestdeltaangle0 -= angle0delta;
            kinematicrestdeltaangle1 -= angle1delta;
            kinematicrestdeltaangle2 -= angle2delta;

            Kinematic(angle0delta, angle1delta, angle2delta);
        }
        else
        {
            drive.Update();
        }
    }
Пример #4
0
 void FixedUpdate()
 {
     drive.Update();
 }