1glayfan Posted April 23, 2018 Share Posted April 23, 2018 Current this is what I need to do to get the device id, using webvr api directly. this.vrHelper.onEnteringVR.add(() => { navigator.getVRDisplays().then((displays) => { for (let display of displays) { console.log(`**** Device: id=${display.displayId}, name=${display.displayName}`); } }); The displayId prop is not reliable as it always returns 1 regardless which actual hmd I am using (vive or winmr or other) The displayName prop is also not consistent among browsers. For ex: when I am using vive hmd, firefox returns 'OpenVR HMD' while chrome returns 'HTC Vive MV.' I wonder if bjs has api to do this. Ideally returning some kind of enum which we can use it reliably. Quote Link to comment Share on other sites More sharing options...
Sebavan Posted April 24, 2018 Share Posted April 24, 2018 Ping @trevordev Thanks :-) Quote Link to comment Share on other sites More sharing options...
HoloLite Posted April 24, 2018 Share Posted April 24, 2018 If your app forces the user to use the controller from the beginning then you can call BABYLON.WebVRController.controllerType to get the enum which is defined like the following: enum PoseEnabledControllerType { /** * HTC Vive */ VIVE = 0, /** * Oculus Rift */ OCULUS = 1, /** * Windows mixed reality */ WINDOWS = 2, /** * Samsung gear VR */ GEAR_VR = 3, /** * Google Daydream */ DAYDREAM = 4, /** * Generic */ GENERIC = 5, } But again this will work only if your app always uses the controller. trevordev 1 Quote Link to comment Share on other sites More sharing options...
trevordev Posted April 24, 2018 Share Posted April 24, 2018 Babylon can only expose what the browser makes available and to my knowledge the webVR spec does not provide any way to do this, I believe by design(spec). If you are trying to figure out the capabilities of the device currently connected you could use display.capabilities otherwise if you are trying to show a different ui for a device type HoloLites solution seems like the best option at this time. HoloLite and 1glayfan 2 Quote Link to comment Share on other sites More sharing options...
1glayfan Posted April 24, 2018 Author Share Posted April 24, 2018 Not capabilities, only the device ID, as the app logic may depend on certain hardware idiosyncrasies. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.