Xav Posted December 8, 2016 Share Posted December 8, 2016 Hello! Thank you for the new version of the Babylon.js. But i have a question with the VrCamera. On this version the mousse inputs don't work ? http://www.babylonjs-playground.com/#VVCUZ There is any solutions on this probleme ? Thank, Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 8, 2016 Share Posted December 8, 2016 Hello this is because rotation is controlled by the VR orientation events. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted December 8, 2016 Share Posted December 8, 2016 hmm. With no VR device connected to browser... mouse should supersede, as it is one of the inputs attached to a vr Dev Or Free Cam (vrdofc?) by default. Plus, camera._vrEnabled = false should... I dunno what it does, to be frank. If one input is disconnected/unavailable, camera inputs should fallback to mouse control... it seems. Not my issue or problem, but... this doesn't smell right. I have lots to learn, though, esp about camera inputs. http://www.babylonjs-playground.com/#5W4LY#2 Removed devOrient input - shrug. Learning learning learning (and checking Deltakosh's ducks... to see if they are in a row) Quote Link to comment Share on other sites More sharing options...
Xav Posted December 9, 2016 Author Share Posted December 9, 2016 Yes It's strange. Especially that it worked perfectly well on this old version. "babylon.2.4_Alpha.js". Even by disconnecting the Vr-event does not change anything. Finally nothing very serious is just less convenient to debug on a computer. Thanks. babylon.2.4_Alpha.js Wingnut 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 9, 2016 Share Posted December 9, 2016 A VR Device Oriented camera is just that - a camera controlled by the device's orientation. The camera input architecture allows you to add the mouse input to the party, but if a single device orientation event was send, this orientation will win over the mouse changes. a VR camera is also rather special - it should be used only on mobiles (cardboard-style) or on Vive and co. (WebVR style), both don't need any mouse input. I won't ask why you need a mouse input, I will just say that the use-case was not considered important. You can always detect on which device you are running and change the camera type. for example, register yourself to listen to device orientation events and if you receive any, set the camera to be device orientation camera. And if not, fallback to the universal camera. Having said that - the actual problem with the mouse rotation in your demo is the fact that the mouse changes the rotation object of the camera, but a VR camera is required to have a rotation quaternion. Constantly updating the quaternion from the rotation will work - http://www.babylonjs-playground.com/#VVCUZ#2 . It should actually work this way, I guess the auto-conversion was somehow taken out of the code. I will see what can be done here. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
Xav Posted December 9, 2016 Author Share Posted December 9, 2016 Hello RaananW, Thank you for your response. I agree with you the Vrcamera is only useful on mobile or Vive ... For my project I have to switch from an arcRotate camera to a Vrcam depending on the chosen mode. Everything works very well the only problem is to be able to debeug locally (the mode of interaction changes to be adapted to the cardboard ...) I am not aware of a solution to simulate the orientations event of the mobil on local on my computeur. My solution is to work locally with the old version of Babylon and pass the new one when I upload. But I will be able to test with your solution. And I have these error in the console: "hand.js:381 The deviceorientation event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.customAddEventListener @ hand.js:381" Do you think it could come from hands.js? Thank you. Quote Link to comment Share on other sites More sharing options...
RaananW Posted December 9, 2016 Share Posted December 9, 2016 Hi, Constantly converting the rotation will work for debugging, so that's solved :-) About the warning, it simply tells you that ssl connection should be used (In production). It shouldn't bother you otherwise. 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.