-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to identify VR Hardware Make when Role binding in BodyRoles.cs #38
Comments
The controller rotation is get from UnityEngine.XR, VIU doesn't change it. And for identifying hardware, VRModule.GetDeviceState(i).deviceModel reveals the device model known by VIU. public enum VRModuleDeviceModel
{
Unknown,
ViveHMD,
ViveController,
ViveTracker,
ViveBaseStation,
OculusHMD,
OculusTouchLeft,
OculusTouchRight,
OculusSensor,
KnucklesLeft,
KnucklesRight,
DaydreamHMD,
DaydreamController,
ViveFocusHMD,
ViveFocusFinch,
} |
I'm more trying to find out, is this an rift controller or vive controller. I'm not having any trouble is device orientation. Full trigger press also doesn't seem to be reading from the rift. so what you posted should be all I need. Thanks again |
NullReferenceException: Object reference not set to an instance of an object This is how I tried to do the checks, Based on the errors I saw I think its not the right way: Debug.Log("Hardware model detected: " + VRModule.GetDeviceState(0).deviceModel);
|
In the previous comment the Null reference Exception is because deviceModel doesn't get set until after we're doing default role setup in the role binding modules. What is the right way to do this check when initiall setting up controllers so when we haven't explicitly mapped controllers to have them default to a per platform controller binding. The problem i'm solving here is that the controller grip angles for each controller platform are different, so a different controller is created for each platform, and if we default all controllers to the vive controller default we have set up, the angle of the controller is off on rift and wrm controllers. |
I no longer reproduce the previous error, Devices are being detected properly on init. The issue i'm seeing now with this section of code: if(VRModule.GetDeviceState(0).deviceModel == VRModuleDeviceModel.OculusHMD) { when i programatically set the device role on init, the rotation set this way, as opposed to with the binding ingerface is off by about 5 degrees. I'm not sure what could be causing it. |
I'm borrowing a rift from a friend to make some software updates, the 1st issue I ran into when I started testing, is the controller angle is vastly different of a rift controller, compared to a vive. I've already created new objects to bind them to, but on rift controllers I want to on device init,bind them to the other objects in BodyRoles.cs I'm just not sure what variable to check for me to know if they should be bound to another device.
The text was updated successfully, but these errors were encountered: