Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/model-comp' into v7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
MattFiler committed Sep 5, 2024
2 parents bcc5a94 + c3df7f4 commit 510d9cb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions Packages/Tracking/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed the default float height for UIInputCursor
- Increased timeout and retry delay in ServerStatus to reduce GetServerStatus fails
- Fixed an instance where ServerStatus would report a nullref if the devices array fails to populate
- Fixed MRTK integration (updated finger/bone methods for new 7.0.0 implementation)


## [7.0.0] - 22/07/2024
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,53 +138,53 @@ Pose GetJointFromLeapHand(TrackedHandJoint joint, Leap.Hand hand)
case TrackedHandJoint.Wrist:
return new Pose(hand.WristPosition, hand.Arm.Rotation);
case TrackedHandJoint.ThumbMetacarpal:
return new Pose(hand.GetThumb().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).PrevJoint, hand.GetThumb().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.THUMB].bones[(int)Bone.BoneType.PROXIMAL].PrevJoint, hand.fingers[(int)Finger.FingerType.THUMB].bones[(int)Bone.BoneType.PROXIMAL].Rotation);
case TrackedHandJoint.ThumbProximal:
return new Pose(hand.GetThumb().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).PrevJoint, hand.GetThumb().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.THUMB].bones[(int)Bone.BoneType.INTERMEDIATE].PrevJoint, hand.fingers[(int)Finger.FingerType.THUMB].bones[(int)Bone.BoneType.INTERMEDIATE].Rotation);
case TrackedHandJoint.ThumbDistal:
return new Pose(hand.GetThumb().Bone(Leap.Bone.BoneType.TYPE_DISTAL).PrevJoint, hand.GetThumb().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.THUMB].bones[(int)Bone.BoneType.DISTAL].PrevJoint, hand.fingers[(int)Finger.FingerType.THUMB].bones[(int)Bone.BoneType.DISTAL].Rotation);
case TrackedHandJoint.ThumbTip:
return new Pose(hand.GetThumb().Bone(Leap.Bone.BoneType.TYPE_DISTAL).NextJoint, hand.GetThumb().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.THUMB].bones[(int)Bone.BoneType.DISTAL].NextJoint, hand.fingers[(int)Finger.FingerType.THUMB].bones[(int)Bone.BoneType.DISTAL].Rotation);
case TrackedHandJoint.IndexMetacarpal:
return new Pose(hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_METACARPAL).PrevJoint, hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_METACARPAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.METACARPAL].PrevJoint, hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.METACARPAL].Rotation);
case TrackedHandJoint.IndexProximal:
return new Pose(hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).PrevJoint, hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.PROXIMAL].PrevJoint, hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.PROXIMAL].Rotation);
case TrackedHandJoint.IndexIntermediate:
return new Pose(hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).PrevJoint, hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.INTERMEDIATE].PrevJoint, hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.INTERMEDIATE].Rotation);
case TrackedHandJoint.IndexDistal:
return new Pose(hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_DISTAL).PrevJoint, hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.DISTAL].PrevJoint, hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.DISTAL].Rotation);
case TrackedHandJoint.IndexTip:
return new Pose(hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_DISTAL).NextJoint, hand.GetIndex().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.DISTAL].NextJoint, hand.fingers[(int)Finger.FingerType.INDEX].bones[(int)Bone.BoneType.DISTAL].Rotation);
case TrackedHandJoint.MiddleMetacarpal:
return new Pose(hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_METACARPAL).PrevJoint, hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_METACARPAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.METACARPAL].PrevJoint, hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.METACARPAL].Rotation);
case TrackedHandJoint.MiddleProximal:
return new Pose(hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).PrevJoint, hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.PROXIMAL].PrevJoint, hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.PROXIMAL].Rotation);
case TrackedHandJoint.MiddleIntermediate:
return new Pose(hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).PrevJoint, hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.INTERMEDIATE].PrevJoint, hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.INTERMEDIATE].Rotation);
case TrackedHandJoint.MiddleDistal:
return new Pose(hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_DISTAL).PrevJoint, hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.DISTAL].PrevJoint, hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.DISTAL].Rotation);
case TrackedHandJoint.MiddleTip:
return new Pose(hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_DISTAL).NextJoint, hand.GetMiddle().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.DISTAL].NextJoint, hand.fingers[(int)Finger.FingerType.MIDDLE].bones[(int)Bone.BoneType.DISTAL].Rotation);
case TrackedHandJoint.RingMetacarpal:
return new Pose(hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_METACARPAL).PrevJoint, hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_METACARPAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.METACARPAL].PrevJoint, hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.METACARPAL].Rotation);
case TrackedHandJoint.RingProximal:
return new Pose(hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).PrevJoint, hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.PROXIMAL].PrevJoint, hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.PROXIMAL].Rotation);
case TrackedHandJoint.RingIntermediate:
return new Pose(hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).PrevJoint, hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.INTERMEDIATE].PrevJoint, hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.INTERMEDIATE].Rotation);
case TrackedHandJoint.RingDistal:
return new Pose(hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_DISTAL).PrevJoint, hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.DISTAL].PrevJoint, hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.DISTAL].Rotation);
case TrackedHandJoint.RingTip:
return new Pose(hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_DISTAL).NextJoint, hand.GetRing().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.DISTAL].NextJoint, hand.fingers[(int)Finger.FingerType.RING].bones[(int)Bone.BoneType.DISTAL].Rotation);
case TrackedHandJoint.LittleMetacarpal:
return new Pose(hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_METACARPAL).PrevJoint, hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_METACARPAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.METACARPAL].PrevJoint, hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.METACARPAL].Rotation);
case TrackedHandJoint.LittleProximal:
return new Pose(hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).PrevJoint, hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_PROXIMAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.PROXIMAL].PrevJoint, hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.PROXIMAL].Rotation);
case TrackedHandJoint.LittleIntermediate:
return new Pose(hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).PrevJoint, hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_INTERMEDIATE).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.INTERMEDIATE].PrevJoint, hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.INTERMEDIATE].Rotation);
case TrackedHandJoint.LittleDistal:
return new Pose(hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_DISTAL).PrevJoint, hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.DISTAL].PrevJoint, hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.DISTAL].Rotation);
case TrackedHandJoint.LittleTip:
return new Pose(hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_DISTAL).NextJoint, hand.GetPinky().Bone(Leap.Bone.BoneType.TYPE_DISTAL).Rotation);
return new Pose(hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.DISTAL].NextJoint, hand.fingers[(int)Finger.FingerType.PINKY].bones[(int)Bone.BoneType.DISTAL].Rotation);
}

return new Pose(hand.PalmPosition, hand.Rotation);
Expand Down

0 comments on commit 510d9cb

Please sign in to comment.