HoloLite Posted March 8, 2018 Share Posted March 8, 2018 I am getting this exception when I click the trigger button on the Firefox/Vive/Steam platform. Note that this works fine on same machine with Supermedium browser (Supermedium/Vive/Steam stack). And certainly runs fine with Edge/WinMR hmd. The impacted code snippet follows: this._vrHelper.onControllerMeshLoadedObservable.add((c: BABYLON.WebVRController, eventState: BABYLON.EventState) => { console.log('>>>> onControllerMeshLoadedObservable'); let controller = <BABYLON.WindowsMotionController>c; controller.onMenuButtonStateChangedObservable.add((eventData: BABYLON.ExtendedGamepadButton, eventState: BABYLON.EventState) => { this.menuButtonObserver(controller, eventState); }); controller.onTriggerButtonStateChangedObservable.add((eventData: BABYLON.ExtendedGamepadButton, eventState: BABYLON.EventState) => { this.triggerButtonObserver(controller, eventState); }); controller.onTouchpadValuesChangedObservable.add((stickValue: BABYLON.StickValues, eventState: BABYLON.EventState) => { this.touchpadValueObserver(stickValue, eventState); }); controller.onTouchpadButtonStateChangedObservable.add((gamepadButton: BABYLON.ExtendedGamepadButton, eventState: BABYLON.EventState) => { this.touchpadButtonObserver(gamepadButton, eventState); }); console.log('<<<< onControllerMeshLoadedObservable'); }); This is kinda bizarre as supermedium and firefox are supposed to be similar. Don't know if this is babylonjs issue or firefox issue, if anyone knows please let me know. And here is the console log errors on FireFox: Quote Link to comment Share on other sites More sharing options...
Guest Posted March 9, 2018 Share Posted March 9, 2018 How can we repro this issue? Do you have a hosted version somewhere? Pinging @trevordev Quote Link to comment Share on other sites More sharing options...
HoloLite Posted March 9, 2018 Author Share Posted March 9, 2018 It's only running locally here unfortunately. I will try to create a PG that can repro this. Will let you know. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 9, 2018 Share Posted March 9, 2018 Thanks! Quote Link to comment Share on other sites More sharing options...
trevordev Posted March 9, 2018 Share Posted March 9, 2018 I managed to repro. Looks like "new PointerEvent()" does not work in FireFox but is supported in Edge and Chrome Created: https://github.com/BabylonJS/Babylon.js/issues/3916 Quote Link to comment Share on other sites More sharing options...
trevordev Posted March 9, 2018 Share Posted March 9, 2018 To work around this for now it looks like you can got to about:config in firefox and set dom.w3c_pointer_events.enabled to true Quote Link to comment Share on other sites More sharing options...
HoloLite Posted March 9, 2018 Author Share Posted March 9, 2018 Great, you found the issue. I will try the work around. Thanks! Quote Link to comment Share on other sites More sharing options...
trevordev Posted March 13, 2018 Share Posted March 13, 2018 So it looks like Babylon does not provide a poly-fill for the PointerEvent constructor (see discussion in the issue I created above). To get support for this in firefox you can include the PEP poly-fill (https://github.com/jquery/PEP) How to do this is described here: http://doc.babylonjs.com/babylon101/first Quote Link to comment Share on other sites More sharing options...
HoloLite Posted March 13, 2018 Author Share Posted March 13, 2018 @trevordev Thanks for the info! I will do this approach for now. Going forward, will babylon add this support or do I need to keep using the pep.js ? Quote Link to comment Share on other sites More sharing options...
trevordev Posted March 13, 2018 Share Posted March 13, 2018 You will need to keep using pep.js for now. Hopefully firefox will add support for this without the flag in the future. HoloLite 1 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.