Currently sets to first device found.
[ ] ...
[ ] All of them
[x] Chromium VR (webvr.info)
[] All of them
With both Oculus CV1 and HTC Vive connected, both enumerate as devices, but we should present some kind of UI to select between the devices.
The WebVR Polyfill needs to change to support this too.
This affects both VREffect
and VRControls
. FWIW, VRControls
used to support multiple devices but for WebVR v1.0 support, VRControls
was changed to allow only the first one.
VRControls
and VREffect
are now deprecated. navigator.getVRDisplays()
is only called in /examples/js/vr/WebVR.js
and thus outside of the core.
https://github.com/mrdoob/three.js/blob/a39c258cb5398cb56a9af3f1a05e0544991f686a/examples/js/vr/WebVR.js#L102-L115
In the interests of simplification, the examples always use the first available device and i think that's okay. An UI for selecting the device should be implemented on app level.
Just FYI: this issue can probably be closed (and deferred until WebXR spec changes to allow multiple devices, but it probably won't any time soon).
So, in WebXR (the sucessor to WebVR v1.1): navigator.getVRDisplays().then(displays => { enterVR(displays[0]) })
is to be replaced with navigator.xr.requestDevice(device => { enterVR(device) })
The Chrome team got this working actually behind a flag already. Check it out, and these examples, and look who's contributed! :smile:
and look who's contributed! 馃槃
Took me awhile to spot what the exactly the change was but indeed the contribution is legit 馃槀
Most helpful comment
Just FYI: this issue can probably be closed (and deferred until WebXR spec changes to allow multiple devices, but it probably won't any time soon).
So, in WebXR (the sucessor to WebVR v1.1):
navigator.getVRDisplays().then(displays => { enterVR(displays[0]) })
is to be replaced withnavigator.xr.requestDevice(device => { enterVR(device) })
The Chrome team got this working actually behind a flag already. Check it out, and these examples, and look who's contributed! :smile: