ViveSoftware / ViveInputUtility-Unity

A toolkit that helps developing/prototyping VR apps.
http://u3d.as/uF7
Other
352 stars 82 forks source link

WEB VR input mapping. #130

Open alessiograncini opened 5 years ago

alessiograncini commented 5 years ago

Hello everyone, I am trying to map the VIU inputs on the [WebVR unity template ] https://assetstore.unity.com/packages/templates/systems/webvr-assets-109152 WebVRInpuMap

I really don't get how this works, since the VIU inputs are defined only through axis and there are not button IDs descriptions. I am doing remapping through the usual VIVE inputs OpenVR list I can find on the Unity documentation. https://docs.unity3d.com/Manual/OpenVRControllers.html

Hoewever, not sure that this is gonna work / or work with multiple headset. In my case I usually work on WMR.

Let me know, thank you.

chengnay commented 5 years ago

@alessiograncini Every plugin has its own unique way of input mapping. I think it is not easy to map VIU inputs onto WebVR unity template. Why don't you just use VIU plugin for development? VIU supports almost all VR devices including WMR.

lawwong commented 5 years ago

If remapping doesn't work, I think maybe by creating new WebVRModule.

alessiograncini commented 5 years ago

@lawwong @chengnay thanks for the quick support. I am aware of the fact that VIU supports WMR and more, I am actually used to build using VIU since you can integrate the scene in multiple headsets.

My question addresses more the WebVR purpose. You can see my efforts in the images.

VIU - gamepad VIU - mine

.How would you proceed trying to create a new WebVR module for VIU if that's the only case ? . The unity WebVR plugin includes a controller map based on GamepadIDs / is the Gmaepad Id referencing this ? . Why the VIU inputs are only based on Axis and they don't match at all the documentations for OpenVR controllers ?

However, I will try keep going with this and hopefully publishing the finished project for many others. I successfully loaded the scene on my website through AWS storage and it's great, I just would like to work with a larger number of inputs for the controller. The demo offers grip and trigger only.

alessiograncini commented 5 years ago

Further updates. Creating the inputs for OpenVR from the unity documentations and mapping them to the Gamepad Ids of the WebVR templates, as suggested in the WebVR repo documentation, I successfully play the scene in Unity having the right response from the controller. Unfortunately on the Web the controller inputs are not recognized - I still can see them. [in my scene there are no components referencing VIU when it plays correctly in Unity].

sc1 sc2 sc3

alessiograncini commented 5 years ago

Further update. Got rid of VIU. Indeed, I don't need it. my only goal was mapping the OpenVR inputs on the webVR inputs. Success on Unity at runtime. Not the same on the web. Is there any specific way to do it ? Thank you.