Exemplo n.º 1
0
 private void Snap(float angle, bool forcePosition)
 {
     if (angularJoint != null)
     {
         angularJoint.SetTarget(angle);
     }
     else if (forcePosition)
     {
         joint.ApplyXAngle(invInitialLocalRotation, angle);
     }
     else
     {
         joint.SetXAngleTarget(angle);
     }
 }
Exemplo n.º 2
0
        protected override void SetJoint(float pos, float spring, float damper)
        {
            joint.SetXAngleTarget(pos);
            JointDrive angularXDrive = joint.angularXDrive;

            angularXDrive.positionSpring = spring;
            angularXDrive.positionDamper = damper;
            joint.angularXDrive          = angularXDrive;
            if (SignalManager.skipTransitions)
            {
                joint.ApplyXAngle(invInitialLocalRotation, pos);
            }
            else
            {
                body.WakeUp();
            }
        }