Skip to content

Commit c7d1af3

Browse files
authored
Merge pull request #1667 from ultraleap/feature/UNITY-1541_Undo_Fingertip_Adjustments_for_Capsule_Hands_And_OpenXR
Undoing capsule hand fingertip adjustments and OpenXR related changes…
2 parents a63dcd1 + 5719b9a commit c7d1af3

File tree

3 files changed

+4
-23
lines changed

3 files changed

+4
-23
lines changed

Packages/Tracking/CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010

1111
### Added
1212
- Added a warning to Physical Buttons when no Physical Hands Manager is in the scene
13-
- Added a checkbox to enable offsetting fingertip capsules in CapsuleHand
1413
- Added a checkbox to enable fiducial marker tracking within the LeapC service
1514

1615
### Changed
1716
- Non-convex MeshColliders are skipped when processing Physical Hands
18-
- Adjusted OpenXR fingertip data to match LeapC more closely
1917
- Removed old conditional support for Unity 2021.3.18 since 2022 is the oldest LTS version we support
2018

2119
### Fixed

Packages/Tracking/Core/Runtime/Scripts/Hands/CapsuleHand.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ public CapsuleHandPreset Preset
7373
[SerializeField]
7474
private bool _joinThumbProximal = true;
7575

76-
[Space, SerializeField, Tooltip("If enabled, this will back-offset the fingertip spheres to better represent actual tips.")]
77-
private bool _offsetTipSphere = false;
78-
7976
[Space, SerializeField]
8077
private bool _castShadows = true;
8178

@@ -382,11 +379,6 @@ public override void UpdateHand()
382379
else
383380
{
384381
position = finger.GetBone((Bone.BoneType)j).NextJoint;
385-
if (j == 3 && _offsetTipSphere)
386-
{
387-
// Fingertips need to be adjusted back by a radii to account for sphere drawing.
388-
position -= finger.GetBone((Bone.BoneType)j).Direction * _jointRadius;
389-
}
390382
}
391383

392384
_spherePositions[key] = position;

Packages/Tracking/OpenXR/Runtime/Scripts/OpenXRLeapProvider.cs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -220,23 +220,14 @@ private bool PopulateLeapHandFromOpenXRJoints(HandTracker handTracker, ref Hand
220220
continue;
221221
}
222222

223-
var prevJointPosition = prevJoint.Pose.position;
224-
var nextJointPosition = nextJoint.Pose.position;
225-
226-
// Adjust the fingertip positions forward by a radius to match LeapC data.
227-
if (boneIndex == 3)
228-
{
229-
nextJointPosition += prevJoint.Pose.forward * nextJoint.Radius;
230-
}
231-
232223
// Populate the finger bone information
233224
var bone = hand.fingers[fingerIndex].bones[boneIndex];
234225
bone.Fill(
235-
prevJointPosition,
236-
nextJointPosition,
237-
((prevJointPosition + nextJointPosition) / 2f),
226+
prevJoint.Pose.position,
227+
nextJoint.Pose.position,
228+
((prevJoint.Pose.position + nextJoint.Pose.position) / 2f),
238229
prevJoint.Pose.forward,
239-
(prevJointPosition - nextJointPosition).magnitude,
230+
(prevJoint.Pose.position - nextJoint.Pose.position).magnitude,
240231
prevJoint.Radius * 1.5f, // 1.5 to convert from joint radius to bone width (joints bigger than bones)
241232
(Bone.BoneType)boneIndex,
242233
prevJoint.Pose.rotation);

0 commit comments

Comments
 (0)