public FingerPose(FingerModel finger, string key) { this.finger = finger.finger; for (int b = 0; b < finger.bonesFromRootToTip.Count; b++) { if (!finger.bonesFromRootToTip[b].reprs.ContainsKey(key)) { Debug.LogError("Finger " + finger.name + " does not have a " + key + " representation of bone " + finger.bonesFromRootToTip[b].name + ". FingerPose cannot be created completely"); break; } bones.Add(new AbstractTsf(finger.bonesFromRootToTip[b].reprs[key].transformRef, Space.Self)); } }
public static HumanBodyBones GetHumanFingerBone(Side s, HumanFinger finger, int distanceFromDitalBone) { switch (s) { case Side.Left: switch (finger) { case HumanFinger.Thumb: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.LeftThumbDistal); case 1: return(HumanBodyBones.LeftThumbIntermediate); case 2: return(HumanBodyBones.LeftThumbProximal); } break; case HumanFinger.Index: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.LeftIndexDistal); case 1: return(HumanBodyBones.LeftIndexIntermediate); case 2: return(HumanBodyBones.LeftIndexProximal); } break; case HumanFinger.Middle: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.LeftMiddleDistal); case 1: return(HumanBodyBones.LeftMiddleIntermediate); case 2: return(HumanBodyBones.LeftMiddleProximal); } break; case HumanFinger.Ring: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.LeftRingDistal); case 1: return(HumanBodyBones.LeftRingIntermediate); case 2: return(HumanBodyBones.LeftRingProximal); } break; case HumanFinger.Pinky: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.LeftLittleDistal); case 1: return(HumanBodyBones.LeftLittleIntermediate); case 2: return(HumanBodyBones.LeftLittleProximal); } break; } break; case Side.Right: switch (finger) { case HumanFinger.Thumb: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.RightThumbDistal); case 1: return(HumanBodyBones.RightThumbIntermediate); case 2: return(HumanBodyBones.RightThumbProximal); } break; case HumanFinger.Index: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.RightIndexDistal); case 1: return(HumanBodyBones.RightIndexIntermediate); case 2: return(HumanBodyBones.RightIndexProximal); } break; case HumanFinger.Middle: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.RightMiddleDistal); case 1: return(HumanBodyBones.RightMiddleIntermediate); case 2: return(HumanBodyBones.RightMiddleProximal); } break; case HumanFinger.Ring: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.RightRingDistal); case 1: return(HumanBodyBones.RightRingIntermediate); case 2: return(HumanBodyBones.RightRingProximal); } break; case HumanFinger.Pinky: switch (distanceFromDitalBone) { case 0: return(HumanBodyBones.RightLittleDistal); case 1: return(HumanBodyBones.RightLittleIntermediate); case 2: return(HumanBodyBones.RightLittleProximal); } break; } break; } return(HumanBodyBones.LastBone); }
public FingerPose(HumanFinger finger) { this.finger = finger; }
public FingerPose() { finger = HumanFinger.None; }