private void TransformArmData(ref LeapArmData arm)
    {
        LeapForearmData forearm = arm.forearm;
        LeapHandData    hand    = arm.hand;

        LeapFingerData[] fingers = hand.fingers;

        // Fingers
        for (int i = 0; i < fingers.Length; ++i)
        {
            LeapFingerData finger = fingers[i];
            finger.TipPosition           = TransformVector(finger.TipPosition);
            finger.StabilizedTipPosition = TransformVector(finger.StabilizedTipPosition);
            finger.FingerDirection       = TransformVector(finger.FingerDirection);
            finger.TipVelocity           = TransformVector(finger.TipVelocity);
        }

        // Hand
        hand.PalmPosition           = TransformVector(hand.PalmPosition);
        hand.StabilizedPalmPosition = TransformVector(hand.StabilizedPalmPosition);
        hand.PalmNormal             = TransformVector(hand.PalmNormal);
        hand.PalmVelocity           = TransformVector(hand.PalmVelocity);
        hand.PalmToFingersDirection = TransformVector(hand.PalmToFingersDirection);

        // Forearm
        forearm.WristPosition    = TransformVector(forearm.WristPosition);
        forearm.ForearmDirection = TransformVector(forearm.ForearmDirection);
        forearm.ElbowPosition    = TransformVector(forearm.ElbowPosition);
    }
예제 #2
0
 public void BeginHand(byte[] arrHand)
 {
     Enable = true;
     hand_  = LeapHandData.Deserialize(arrHand);
     InitHand();
     BeginHand();
     UpdateHand();
 }
예제 #3
0
 public void SetLeapHand(byte[] arrHand)
 {
     if (hand_ == null)
     {
         hand_ = LeapHandData.Deserialize(arrHand);
         InitHand();
         BeginHand();
         UpdateHand();
     }
     else
     {
         hand_ = LeapHandData.Deserialize(arrHand);
         UpdateHand();
     }
 }
예제 #4
0
 public override void SetLeapHand(Hand hand)
 {
     if (hand_ == null)
     {
         hand_ = hand;
         if (hand != null && player != null)
         {
             player.BeginHand((int)Handedness, LeapHandData.Serialize(hand));
         }
     }
     else
     {
         hand_ = hand;
         if (hand != null && player != null)
         {
             player.SetLeapHand((int)Handedness, LeapHandData.Serialize(hand));
         }
     }
 }
예제 #5
0
 public void SetLeapHand(byte[] arrHand)
 {
     hand_ = LeapHandData.Deserialize(arrHand);
     UpdateHand();
 }