Jump to content

Vr Camera mousse input ?


Recommended Posts

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.


Removed devOrient input - shrug.  Learning learning learning (and checking Deltakosh's ducks... to see if they are in a row)  ;)

Link to comment
Share on other sites

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.


Link to comment
Share on other sites

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. ;)

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...