Skip to content

Commit 16ce6be

Browse files
committed
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.
1 parent 4f5b465 commit 16ce6be

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

org.mixedrealitytoolkit.input/Tracking/HandPoseDriver.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@ public class HandPoseDriver : TrackedPoseDriver
3333
private bool m_firstUpdate = true;
3434
private InputAction m_boundTrackingAction = null;
3535
private InputTrackingState m_trackingState = InputTrackingState.None;
36+
private const InputTrackingState m_polyfillTrackingState = InputTrackingState.Position | InputTrackingState.Rotation;
3637

3738
/// <summary>
3839
/// Expose the tracking state for the hand pose driver, to allow <see cref="TrackedPoseDriverExtensions"/> to query it.
3940
/// </summary>
4041
/// <remarks>
4142
/// Avoid exposing this publicly as this <see cref="HandPoseDriver"/> is a workaround solution to support hand tracking on devices without interaction profiles.
4243
/// </remarks>
43-
internal InputTrackingState CachedTrackingState => m_trackingState;
44+
internal InputTrackingState CachedTrackingState => IsPolyfillDevicePose ? m_polyfillTrackingState : m_trackingState;
4445

4546
/// <summary>
4647
/// Get if the last pose set was from a polyfill device pose. That is, if the last pose originated from the <see cref="XRSubsystemHelpers.HandsAggregator "/>.
@@ -94,7 +95,6 @@ protected override void PerformUpdate()
9495
if ((missingPositionController || missingRotationController || IsTrackingNone()) &&
9596
TryGetPolyfillDevicePose(out Pose devicePose))
9697
{
97-
m_trackingState = InputTrackingState.Position | InputTrackingState.Rotation;
9898
IsPolyfillDevicePose = true;
9999
ForceSetLocalTransform(devicePose.position, devicePose.rotation);
100100
}

0 commit comments

Comments
 (0)