Conversation
…Skeleton Root cause: inside OVRSkeleton.BoneId, the legacy OVR hand (Hand_*) and the OpenXR hand (XRHand_*) members fully overlap numerically (for example, Hand_IndexTip and XRHand_RingTip are both 20). OVRSkeleton's BoneLabelFromBoneId dispatches on numeric value only, so legacy Hand_* IDs passed while using SkeletonType.XRHandLeft/XRHandRight resolve to the wrong joint: Hand_IndexTip returns the ring fingertip instead of the index fingertip (19 of 24 Hand_* IDs mislabeled). Fix: add an additive helper, OVRSkeletonBoneIdExtensions, with: - ToXRHandBoneId(): semantic Hand_* -> XRHand_* translation following the phalange annotations (Hand_Index1 -> XRHand_IndexProximal, Hand_Pinky0 -> XRHand_LittleMetacarpal, Hand_ForearmStub -> XRHand_Wrist; non-Hand IDs pass through unchanged) - GetFingerTipBoneId(skeletonType, finger): per-skeleton-type tip selection, mirroring the per-type pattern the Meta XR Core SDK uses in OVRVirtualKeyboard OVRSkeleton.cs itself ships in com.meta.xr.sdk.core and is not part of this repository, and relabeling the shared numeric value 20 would rename every OpenXR hand's native ring-tip joint, hence the opt-in translation API. The upstream one-line documentation fix should land in the SDK. Verification: standalone C# replication test of OVRPlugin.SkeletonType, all Hand_*/XRHand_* BoneId values (com.meta.xr.sdk.core v81) and the BoneLabelFromBoneId hand branches: 184/184 checks passed (before-fix issue reproduction, after-fix mapping correctness across all 24 Hand_* IDs on both XR hand types, label integrity for all 26 native OpenXR joints, and legacy OVR hand label self-consistency). Unity Editor compilation and on-device Quest verification were not run in this environment; all SDK types/members referenced by the new file were verified by name against the extracted v81 package sources. Fixes oculus-samples#120
|
Hi @HUAN2022A! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Summary
OVRSkeleton.BoneIdoverlays the legacy OVR hand family (Hand_*) and the OpenXR hand family (XRHand_*) in one flat enum whose numeric values fully overlap.BoneLabelFromBoneIddispatches on numeric value only, so legacyHand_*IDs passed while usingSkeletonType.XRHandLeft/XRHandRightresolve to the wrong joint — most visibly,BoneId.Hand_IndexTip(=20) matchescase BoneId.XRHand_RingTip:(=20) and returns the ring fingertip transform instead of the index fingertip (see #120).This PR adds an additive, opt-in helper —
OVRSkeletonBoneIdExtensions— in the Movement package:ToXRHandBoneId(BoneId): semanticHand_*→XRHand_*translation following the phalange annotations (Hand_Index1→XRHand_IndexProximal,Hand_Pinky0→XRHand_LittleMetacarpal,Hand_ForearmStub→XRHand_Wrist; non-Hand_*IDs pass through unchanged)GetFingerTipBoneId(SkeletonType, finger): per-skeleton-type fingertip selection, mirroring the per-type pattern the Meta XR Core SDK itself uses inOVRVirtualKeyboardRoot cause
Verified against the Meta XR Core SDK v81 sources (
com.meta.xr.sdk.core, the version the issue was filed against):OVRPlugin.BoneId:Hand_MaxSkinnable=19, Hand_ThumbTip=19, Hand_IndexTip=20, Hand_MiddleTip=21, Hand_RingTip=22, Hand_PinkyTip=23XRHand_IndexTip=10,XRHand_RingTip=20So
Hand_IndexTipandXRHand_RingTipare the same integer. The enum's own doc comment already warns that "some values of this enum overlap each other". Counting onXRHandLeft, 19 of 24Hand_*IDs are mislabeled by the current dispatch —Hand_IndexTipis just the instance reported in #120.Note that
OVRSkeleton.csitself ships incom.meta.xr.sdk.coreand is not part of this repository, which is why the fix lands here as a translation API rather than an edit to the switch inBoneLabelFromBoneId. Relabeling the shared numeric value 20 inside the SDK enum would rename every OpenXR hand's native ring-tip joint, so the upstream Core SDK likely needs a dispatch fix (or, minimally, a documentation clarification) on its side as well.Fix
com.meta.xr.sdk.movement/Scripts/Utils/OVRSkeletonBoneIdExtensions.csVerification
Standalone C# replication of
OVRPlugin.SkeletonType, allHand_*/XRHand_*BoneId values (Core SDK v81) and theBoneLabelFromBoneIdhand branches:Hand_IndexTip→ "XRHand_RingTip"), after-fix mapping correctness across all 24Hand_*IDs on bothXRHandLeftandXRHandRight, label integrity for all 26 native OpenXR joints, and legacy OVR hand label self-consistencyChecklist
Fixes #120