Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebXRManager: Fix input sources being sent to wrong controllers (touch AR) #23188

Merged
merged 2 commits into from
Jun 17, 2022

Conversation

marwie
Copy link
Contributor

@marwie marwie commented Jan 9, 2022

Related issue: #23187

Description

Adds array of input sources to keep track of controllers being still/currently used on inputSourcesChanged event.
This prevents mixup/re-ordering of touches in AR.

This contribution is funded by 🌵 needle.

@hybridherbst
Copy link
Contributor

hybridherbst commented Apr 2, 2022

Might be superseded by

but I still have to verify.

@mrdoob
Copy link
Owner

mrdoob commented Apr 4, 2022

but I still have to verify

Let us know when you do 🙏

@mrdoob mrdoob modified the milestones: r140, r141 Apr 30, 2022
@hybridherbst
Copy link
Contributor

hybridherbst commented May 10, 2022

Finally got hold of another Hololens 2, here's some findings:

  • WebXRManager: Fix for hand controllers #23830 doesn't fix multitouch AR cases as it only deals with handedness; we rebased and adjusted our original changes and updated this PR here to fix that 🚀

  • there's occassional TypeError: cannot read properties of null (reading 'assetUrl') in XRControllerModelFactory.js:276, not sure where that's suddenly coming from though

  • there is a regression in WebXR pointer handling, when using Hololens 2 every time a hand leaves/enters the view a new VisualResponse (sphere + pointer) is spawned and stuck in the air. This wasn't the case ~r137. This affects all of the hands samples; for example here: https://threejs.org/examples/?q=hand#webxr_vr_handinput_pointerdrag. This doesn't affect Quest hands, only Hololens hands

  • there's another regression (potentially, not sure if this was the case before already) in hand handling on both Quest and Hololens - when wildly clicking around on boxes in this demo https://threejs.org/examples/?q=hand#webxr_vr_handinput_pointerdrag, I can easily get the pointer click to be "stuck" (hand not pinching anymore but cube is following pointer).

cc @cabanier @mrdoob

Also noticed that, tangentially related,

is still open; the problem still exists (no way to set raycast / visibility layers on child objects since there's no callback when the controller/hands model is actually spawned). Problematic on both Quest and Hololens.

@hybridherbst
Copy link
Contributor

@hybridherbst
Copy link
Contributor

@mrdoob @cabanier any input here? Would be great to have multi-controller AR (multitouch, multiple controllers without handedness) working again.

@cabanier
Copy link
Contributor

@mrdoob @cabanier any input here? Would be great to have multi-controller AR (multitouch, multiple controllers without handedness) working again.

The change looks reasonable. What systems did you try it on?

@hybridherbst
Copy link
Contributor

  • Quest 2 (Hands + Controllers)
  • Hololens 2 (both VR and AR mode with hands)
  • a couple of phones (Multitouch when using WebXR in immersive-ar mode)

@mrdoob mrdoob modified the milestones: r141, r142 May 26, 2022
remove inputSourcesMap and instead use controllerInputSources array

fix linting errors
@mrdoob mrdoob changed the title fix input sources being sent to wrong controllers (touch AR) WebXRManager: Fix input sources being sent to wrong controllers (touch AR) Jun 15, 2022
@mrdoob mrdoob merged commit cca9b5c into mrdoob:dev Jun 17, 2022
@mrdoob
Copy link
Owner

mrdoob commented Jun 17, 2022

Thanks!

abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
…h AR) (mrdoob#23188)

* fix controller input sources: stable controller index

remove inputSourcesMap and instead use controllerInputSources array

fix linting errors

* apply review changes
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
…h AR) (mrdoob#23188)

* fix controller input sources: stable controller index

remove inputSourcesMap and instead use controllerInputSources array

fix linting errors

* apply review changes
@hybridherbst hybridherbst deleted the webxr-inputs-sources-fix branch September 27, 2022 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants