예제 #1
0
 public static void UpdateHand(SG_HandAnimator animater, bool calibrating, SG_HandPose pose)
 {
     if (animater != null && calibrating)
     {
         animater.UpdateHand(pose);
     }
 }
예제 #2
0
 public static void UpdateOpenClose(bool isRight, SG_HandAnimator animater, bool calibrating, SGCore.Kinematics.HandInterpolator poseInterp, float normalizedTime01)
 {
     if (animater != null && calibrating && poseInterp != null)
     {
         SGCore.Kinematics.Vect3D[][] handAngles = SGCore.Kinematics.Values.FillZero(5, 3);
         for (int f = 0; f < 5; f++)
         {
             if (f == 0)
             {
                 handAngles[f][0].x = poseInterp.CalculateAngle(SGCore.Kinematics.ThumbMovement.T_CMC_Twist, normalizedTime01);
                 handAngles[f][0].z = poseInterp.CalculateAngle(SGCore.Kinematics.ThumbMovement.T_CMC_Abd, normalizedTime01);
                 handAngles[f][0].y = poseInterp.CalculateAngle(SGCore.Kinematics.ThumbMovement.T_CMC_Flex, normalizedTime01);
                 handAngles[f][1].y = poseInterp.CalculateAngle(SGCore.Kinematics.ThumbMovement.T_MCP_Flex, normalizedTime01);
                 handAngles[f][2].y = poseInterp.CalculateAngle(SGCore.Kinematics.ThumbMovement.T_IP_Flex, normalizedTime01);
             }
             else
             {
                 SGCore.Finger finger = (SGCore.Finger)f;
                 handAngles[f][0].z = poseInterp.CalculateAngle(finger, SGCore.Kinematics.FingerMovement.F_MCP_Abd, normalizedTime01);
                 handAngles[f][0].y = poseInterp.CalculateAngle(finger, SGCore.Kinematics.FingerMovement.F_MCP_Flex, normalizedTime01);
                 handAngles[f][1].y = poseInterp.CalculateAngle(finger, SGCore.Kinematics.FingerMovement.F_PIP_Flex, normalizedTime01);
                 handAngles[f][2].y = poseInterp.CalculateAngle(finger, SGCore.Kinematics.FingerMovement.F_DIP_Flex, normalizedTime01);
             }
         }
         animater.UpdateHand(new SG_HandPose(SGCore.HandPose.FromHandAngles(handAngles, isRight)));
     }
 }