Search Issue Tracker

Fixed

Fixed in 2.4.1

Votes

1

Found in [Package]

2.3.0

Issue ID

XRIT-64

Regression

No

[XR Interaction Toolkit] XRUIInputModule does not handle drag properly when rotating the headset resulting in a Drag event being registered

Package: XR Interaction Toolkit

-

Steps to reproduce:
1. Open the attached user's project "UIDragBugRepro.zip"
2. Launch Oculus Link on a Quest 2 device and enter Play Mode
3. Point the ray at the button and press the trigger, hold the hand steady
4. While pressing down the trigger, rotate your headset
5. Notice how rotating the head caused drag to start, even though the hand didn't move relative to the canvas

Expected results: XRUIInputModule does not handle drag properly when rotating the headset
Actual Results: XRUIInputModule does not handle drag properly when rotating the headset resulting in a Drag event being registered (see attached "2023-03-07 11-55-28.mp4")

Reproducible: XRIT 2.3.0 (2020.3.46f1, 2021.3.21f1, 2022.2.12f1, 2023.1.0b8, 2023.2.0a7)
Could not test below XRIT 2.3.0 due to package errors when downgrading

Environment: Windows 10 22H2

Notes:
-Additionally, it seems that the drag threshold is specified in pixels on headset display, which causes problems when changing a headset to one with a different resolution. It should be specified in e.g. pixels on the canvas instead.
-The drag threshold is processed in camera space instead of world space, resulting in weird behavior when rotating the head. This causes buttons to not work as expected if the head is rotated/moved, which is especially noticeable when using poke for UI interactions.

  1. Resolution Note (fix version 2.4.1):

    When clicking on an object and turning your head, it triggers an OnDrag event, even when the controller is perfectly still. This is due to the conversion of 3D space to 2D space relative to a 2D screen-based camera. With standard 2D controls, the mouse input on the screen is typically in lock-step with the camera itself. In VR, the 3D pointer and camera (head) can be positionally out of sync. This means when you turn your head, the 'screen space camera' sees your pointer moving off the screen when in fact it's staying perfectly still on the world-space canvas.

    This fix saves off the original 3D world-space position where the button press happened and then converts it to screen space each frame due to ensure head movement doesn't give us a false positive on pointer movement. This will ensure that the relative movement of the pointer in world-space is used for drag detection.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.