ViveSoftware / ViveInputUtility-Unity

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

How to properly manage multiple tracker and controller presets with role binding #17

Closed wirelessdreamer closed 6 years ago

wirelessdreamer commented 6 years ago

I have these Roles: RightHand1 RightHand2 LeftHand1 LeftHand2

I have the default Controller (Left), and Controller (Right) children on my camera rig, and I have duplicated Controller (Left) 1, and Controller (Right) 1 on my camera rig. When RightHand1 is bound to the right controller I want it to be the active controller being used for it, etc.

What is the right way in the framework to tie roles into what objects get bound, based on the roles. I didn't that section of code in the example.

If it doesn't exist, where should I put in hooks for this. It looks like in ApplyBindingConfigToRoleMap() we are aware of all controllers, their serials, and roles, but I'm not sure how to properly bind the children of the camera rig based on assigned roles.

dariol commented 6 years ago

You can use the binding shortcut (right-shift b) to select which roles to bind to which controllers (including backup controllers) or trackers - however please note that you should be referencing the controllers by role and not by id. So you'll have to look at using ViveCameraRig or ViveRig instead of SteamVR's CameraRig

wirelessdreamer commented 6 years ago

I have the controller roles bound in the gui. I just don't see a way to assign prefabs to those roles. I'm not familiar with ViveCameraRig or ViveRig, where can I find them?

wirelessdreamer commented 6 years ago

Disabling Steam VR_Controller Manager on the camera rig, and putting a Vive Role Setter, and Vive Pose Tracker script on each of the prefabs is all that was needed. Thanks not sure how I missed that before.