void Update()
 {
     if (UseLeftHand == true && gesture.LeftIsVisible == true)
     {
         currentPos = gesture.LeftHand.PalmPosition.y;
         difference = currentPos - lastPos;
         if (gesture.LeftIsFacingAway == true &&
             gesture.LeftGrab == true)
         {
             mouseControl.ScrollWheel(difference * ScrollSpeed);
         }
         lastPos = currentPos;
     }
     else if (UseLeftHand == false)
     {
         currentPos = gesture.RightHand.PalmPosition.y;
         difference = currentPos - lastPos;
         if (gesture.RightIsFacingAway == true &&
             gesture.RightGrab == true)
         {
             mouseControl.ScrollWheel(difference * ScrollSpeed);
         }
         lastPos = currentPos;
     }
 }
Пример #2
0
 void Update()
 {
     if (gesture.NumberOfHandsVisible == 1)
     {
         if (UseLeftHand == true)
         {
             if (gesture.LeftIsVisible == true &&
                 gesture.LeftIsFacingAway == true)
             {
                 currentPos = gesture.LeftHand.PalmPosition.y;
                 difference = currentPos - lastPos;
                 if (gesture.LeftIsNearPerpendicular == true &&
                     gesture.LeftFingersExtended == true)
                 {
                     mouseControl.ScrollWheel(difference * ScrollSpeed);
                 }
                 lastPos = currentPos;
             }
         }
         else if (UseLeftHand == false)
         {
             if (gesture.RightIsVisible == true &&
                 gesture.RightIsFacingAway == true)
             {
                 currentPos = gesture.RightHand.PalmPosition.y;
                 difference = currentPos - lastPos;
                 if (gesture.RightIsNearPerpendicular == true &&
                     gesture.RightFingersExtended == true)
                 {
                     mouseControl.ScrollWheel(difference * ScrollSpeed);
                 }
                 lastPos = currentPos;
             }
         }
     }
 }