nunuStudio icon indicating copy to clipboard operation
nunuStudio copied to clipboard

Support for VR controllerS (or how to move in VR ?)

Open shantee opened this issue 4 years ago • 3 comments

#Moving in VR ?

Hello I would like to know how to use VR controllers to move in my VR game / scene ? For example how to map the buttons of my Oculus Quest hand controllers in nunuStudio to produce some actions ? Is there a library for that ? Sorry if it is a stupid question. I am still a noob to all VR things. I have check "aframe" which seems to solve this problem quite easily. Would it be possible to include it to NunuStudio ?

Version
  • <0.98.12>
Platform
  • Linux [X]

shantee avatar Aug 08 '20 10:08 shantee

Hello

You can get access to the controls from the rendered object using the following code:

var controller = renderer.xr.getController(0);
controller.addEventListener("selectstart", (...));
controller.addEventListener("selectend", (...));
scene.add(controller);

The controller object is automatically updated to match the physical controller. I will add this and some extra information to a VR page in the learn section.

Thanks a lot!

tentone avatar Aug 10 '20 12:08 tentone

Thanks that helped a lot! Actually unless I am missing something , in nunustudio we have to write :

var controller = program.renderer.xr.getController(0);

shantee avatar Aug 12 '20 16:08 shantee

Yes thats correct. You have to acess the renderer trough the program variable.

Thansk a lot!

tentone avatar Aug 13 '20 09:08 tentone