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

Remove hand-tracking from VRButton's optionalFeatures #27698

Closed
m-blix opened this issue Feb 7, 2024 · 9 comments · Fixed by #27699
Closed

Remove hand-tracking from VRButton's optionalFeatures #27698

m-blix opened this issue Feb 7, 2024 · 9 comments · Fixed by #27699

Comments

@m-blix
Copy link

m-blix commented Feb 7, 2024

Description

VRButton (and XRButton) has hand-tracking as part of the session's optional features.

const sessionInit = { optionalFeatures: [ 'local-floor', 'bounded-floor', 'hand-tracking', 'layers' ] };

https://github.com/mrdoob/three.js/blob/master/examples/jsm/webxr/VRButton.js#L49

With the usage of VRButton in various examples that do not even use the WebXR hand tracking API (e.g. https://threejs.org/examples/webxr_vr_rollercoaster.html) this can trigger multiple successive permission prompts (1st for immersive session, second for hands) on certain platforms (e.g. Safari on visionOS). With the Button's as is this annoyance can't be avoided.

Solution

One option to avoid this is to remove hand-tracking from the optionalFeatures list, and instead provide a way to pass in additional features, similar to XRButton's createButton method.

Or, give access to VRButton.optionalFeatures = [...] for easy modification.

(And modify examples that need hand-tracking accordingly).

Alternatives

Alternatively, this issue can be seen as responsibility of developer to copy and modify VRButton code, adjusting optionalFeatures (or requiredFeatures) to suit their needs.

Additional context

No response

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 7, 2024

One option to avoid this is to remove hand-tracking from the optionalFeatures list, and instead provide a way to pass in additional features, similar to XRButton's createButton method.

I vote for that. We could apply the changes of #27030 to VRButton as well and then update the hand-tracking examples. ARButton.createButton() also has a sessionInit parameter.

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 7, 2024

@m-blix Does #27699 look good to you?

@m-blix
Copy link
Author

m-blix commented Feb 8, 2024

@Mugen87 Yes #27699 looks good 👍

One other consideration, maybe for later or not at all as optionalFeatures is probably fine, but for examples that really require hand-tracking could have hand-tracking as part of session's requiredFeatures list.

@danrossi
Copy link

danrossi commented Mar 1, 2024

These sessions don't work in the visionOS simulator. How is it advised to detect for hand tracking support now it's trying to force it ?

@mrdoob
Copy link
Owner

mrdoob commented Mar 1, 2024

How is it advised to detect for hand tracking support now it's trying to force it ?

Can you rephrase the question? I don't understand it.

@danrossi
Copy link

danrossi commented Mar 2, 2024

These demos won't launch XR on VisionOS simulator as it seems there is no hand tracking to check controls and it requires it. I'll check again but it says "XR Not Allowed" So to support every device keep these properties optional is the advised method ? Making them required seems to only work on anything that supports it and there doesn't seem to be a method to detect what it supports. I'll do more digging. I figured out the visionOS video playback work around for others for now. Standard. I've done it before.

@mrdoob
Copy link
Owner

mrdoob commented Mar 2, 2024

I'm Vision OS 1.1 beta they have started using transient pointers like the ones in Android WebXR. No need for hand tracking.

@Ledzz
Copy link

Ledzz commented Mar 5, 2024

@mrdoob but these pointers exist only when clicking, so there's no way to make "hover" effects, am I right?

@mrdoob
Copy link
Owner

mrdoob commented Mar 6, 2024

That's correct yeah...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants