crani
crani

Reputation: 96

openvr how to get track controllers correctly (C#)

I am using openvr with C# and trying to get the controllers.

All methods require the "trackedDeviceIndex" of the controller but I am not sure how I would get this id the correct way. I looked up the documentation and can only find this method for left or right hand:

OpenVR.System.GetTrackedDeviceIndexForControllerRole(ETrackedControllerRole.RightHand)

Is there any better way to get all tracked controllers in a list or am I using this the wrong way?

Upvotes: 0

Views: 545

Answers (1)

crani
crani

Reputation: 96

So seems like there is not method for that, but you can loop from 0 to k_unMaxTrackedDeviceCount and check the return value.

Upvotes: 1

Related Questions