I have encountered a bug in Babylon.js version 6.x.x that affects the drag functionality when using both the Oculus Quest 2 and Quest Pro. This issue is not present in Babylon v5.x.x.
After thorough debugging and code inspection, I have identified the issue with the sequence of touch events in Babylon v6.x.x. Here is the detailed sequence that leads to the problem:
Babylon v6.x.x:
- Pointer Move (Randomly moving pointer on the canvas):
_activeTouchIds = [2, -1]
- Pointer Down (Press controller and start to drag):
_activeTouchIds = [2, 2]
- Pointer Move (Dragging):
_activeTouchIds = [2, 2]
- Pointer Up (Release controller and stop dragging):
_activeTouchIds = [-1, 2]
- Pointer Move:
_activeTouchIds = [3, 2]
This sequence reveals an unexpected behavior in Babylon v6.x.x, where the touch IDs increase unexpectedly during the drag operation, leading to a failure in subsequent attempts.
Babylon v5.x.x:
- Pointer Move (Randomly moving pointer on the canvas):
_activeTouchIds = [-1, -1]
- Pointer Down (Press controller and start to drag):
_activeTouchIds = [2, -1]
- Pointer Move (Dragging):
_activeTouchIds = [2, -1]
- Pointer Up (Release controller and stop dragging):
_activeTouchIds = [-1, -1]
- Pointer Move:
_activeTouchIds = [-1, -1]
In Babylon v5.x.x, the sequence remains stable, and the touch IDs do not exhibit unexpected increases, ensuring consistent drag functionality.
Steps to Reproduce:
- Use Babylon.js version 6.x.x.
- Open meta quest browser on Oculus Quest 2 or Quest Pro and run any Babylon app.
- Randomly move the pointer on the canvas.
- Press the controller to start dragging.
- Drag and release the controller to stop dragging.
- Notice that dragging fails after the first attempt due to the unexpected increase in touch IDs.
Expected Behavior: Drag operation should work consistently without issues on Babylon v6.x.x, similar to the behavior observed in v5.x.x.
Additional Information:
- Babylon.js version: 6.x.x
- Oculus devices: Quest 2, Quest Pro