nunuStudio
nunuStudio copied to clipboard
Support for VR controllerS (or how to move in VR ?)
#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]
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!
Thanks that helped a lot! Actually unless I am missing something , in nunustudio we have to write :
var controller = program.renderer.xr.getController(0);
Yes thats correct. You have to acess the renderer trough the program variable.
Thansk a lot!