From d2d565163546d33c84cca45eb80608460aa6422a Mon Sep 17 00:00:00 2001 From: Kurtis Date: Wed, 27 Aug 2025 20:18:00 -0700 Subject: [PATCH 1/2] Don't overwrite the actual tracking state This introduced a bug in the XRI3 migration, because the old base class (ActionBasedController) read this value from the action every frame. The new base class (TrackedPoseDriver) only reads the events when the action state changes. --- .../Tracking/HandPoseDriver.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/org.mixedrealitytoolkit.input/Tracking/HandPoseDriver.cs b/org.mixedrealitytoolkit.input/Tracking/HandPoseDriver.cs index 0872c35d6..b0c9dc106 100644 --- a/org.mixedrealitytoolkit.input/Tracking/HandPoseDriver.cs +++ b/org.mixedrealitytoolkit.input/Tracking/HandPoseDriver.cs @@ -33,6 +33,7 @@ public class HandPoseDriver : TrackedPoseDriver private bool m_firstUpdate = true; private InputAction m_boundTrackingAction = null; private InputTrackingState m_trackingState = InputTrackingState.None; + private const InputTrackingState m_polyfillTrackingState = InputTrackingState.Position | InputTrackingState.Rotation; /// /// Expose the tracking state for the hand pose driver, to allow to query it. @@ -40,7 +41,7 @@ public class HandPoseDriver : TrackedPoseDriver /// /// Avoid exposing this publicly as this is a workaround solution to support hand tracking on devices without interaction profiles. /// - internal InputTrackingState CachedTrackingState => m_trackingState; + internal InputTrackingState CachedTrackingState => IsPolyfillDevicePose ? m_polyfillTrackingState : m_trackingState; /// /// Get if the last pose set was from a polyfill device pose. That is, if the last pose originated from the . @@ -48,6 +49,7 @@ public class HandPoseDriver : TrackedPoseDriver internal bool IsPolyfillDevicePose { get; private set; } #region Serialized Fields + [Header("Hand Pose Driver Settings")] [SerializeField, Tooltip("The XRNode associated with this Hand Controller. Expected to be XRNode.LeftHand or XRNode.RightHand.")] @@ -58,9 +60,11 @@ public class HandPoseDriver : TrackedPoseDriver /// /// Expected to be XRNode.LeftHand or XRNode.RightHand. public XRNode HandNode => handNode; + #endregion Serialized Fields #region TrackedPoseDriver Overrides + /// protected override void PerformUpdate() { @@ -94,7 +98,6 @@ protected override void PerformUpdate() if ((missingPositionController || missingRotationController || IsTrackingNone()) && TryGetPolyfillDevicePose(out Pose devicePose)) { - m_trackingState = InputTrackingState.Position | InputTrackingState.Rotation; IsPolyfillDevicePose = true; ForceSetLocalTransform(devicePose.position, devicePose.rotation); } @@ -103,9 +106,11 @@ protected override void PerformUpdate() IsPolyfillDevicePose = false; } } + #endregion TrackedPoseDriver Overrides #region Private Functions + /// /// Check the tracking state here to account for a bound but untracked interaction profile. /// This could show up on runtimes where a controller is disconnected, hand tracking spins up, @@ -278,6 +283,7 @@ private void OnTrackingStateInputCanceled(InputAction.CallbackContext context) m_trackingState = InputTrackingState.None; } } + #endregion Private Functions } } From 35ae4bf7b978dd802ecc75dfaba76794c48f0e80 Mon Sep 17 00:00:00 2001 From: Kurtis Date: Thu, 11 Dec 2025 12:36:01 -0800 Subject: [PATCH 2/2] Update CHANGELOG.md --- org.mixedrealitytoolkit.input/CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org.mixedrealitytoolkit.input/CHANGELOG.md b/org.mixedrealitytoolkit.input/CHANGELOG.md index bb0000f72..c0d4c98a3 100644 --- a/org.mixedrealitytoolkit.input/CHANGELOG.md +++ b/org.mixedrealitytoolkit.input/CHANGELOG.md @@ -2,6 +2,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## Unreleased + +### Fixed + +* Fix issue where `HandPoseDriver` could get into a state where it temporarily polyfilled, but then was unable to, and then got stuck in a "tracked" state. [PR #1088](https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/pull/1088) + ## [4.0.0-pre.2] - 2025-12-05 ### Changed