openvr icon indicating copy to clipboard operation
openvr copied to clipboard

Universal way to grab VR input?

Open NukeBird opened this issue 3 years ago • 4 comments

Currently I'm playing with combination of OpenVR with OpenGL, so most of time I'm looking at this example + docs to figure out how everything works

Additionally, I took a look at dx12 example, and I'm a bit confused about one thing: why gl example uses manifest file (SetActionManifestPath, GetActionHandle, etc.) and dx12 one don't?

My question is: how to grab VR input from different VR systems? Lets say I'm developing app and want to share it with friends with these devices: lenovo explorer (WMR), HTC Vive, Oculus Quest 2. For simplicity, lets say I'm interested in trigger/grip/fist action. Plus, I wanna be sure where left and right hand. Should I really provide my own manifest or is it possible to grab this info from default one? It would be nice if you can share some code with me for better understanding, thank you for help in advance

NukeBird avatar Feb 05 '22 12:02 NukeBird

I kind of get better idea how "universal manifest" files work from here , though I still not sure where to get binding files for specific VR devices? For example, bindings for Vive isn't rare but WMR is kind of

NukeBird avatar Feb 05 '22 12:02 NukeBird

There is a better way to do it, kinda, I don't have the time to give you an example right now, but it all boils down to a generic manifest and VRInput.

okawo80085 avatar Feb 05 '22 12:02 okawo80085

There is a better way to do it, kinda, I don't have the time to give you an example right now, but it all boils down to a generic manifest and VRInput.

you mean hellovr_bindings_generic.json?

NukeBird avatar Feb 05 '22 12:02 NukeBird

The general structure of the new input system is that actions in game are decoupled to hardware inputs. Your application specifies certain "actions", eg. "shoot gun", "open menu" or "walk forward". You can then link these actions you defined in the action manifest file to a bindings profile for each controller.

For your example, you would create an single action in your application, which you then link to each specific input from each bit of hardware in a bindings profile you or the user can create through the bindings web interface. You can ship these bindings profiles with your application, to avoid the user having to make their own ones for their hardware.

The differences between the examples you've mentioned is one is using the old input system, where you fetch the state of the controller directly from it, instead of going through the bindings from input to action. That old system is deprecated in favour of this new input system, though.

danwillm avatar Feb 16 '22 16:02 danwillm