Open Shii2 opened 3 years ago
Issue still persists in SteamVR Plugin v2.7.3 and SteamVR 1.16.8 I contacted Unity about this bug and they answered that this is an issue in SteamVR Plugin or OpenVR XR plugin provided by SteamVR package. To reiterate, headset position tracked correctly, only left and right eye position reported wrong.
For now I'm using this workaround: after getting the position and rotation of the centerEye and the positions of the left and right eye, I do this:
float leftEyeDist = Vector3.Distance(playerEyeCenterXform.position, playerLeftEyeXform.position); float rightEyeDist = Vector3.Distance(playerEyeCenterXform.position, playerRightEyeXform.position);
playerLeftEyeXform.position = playerEyeCenterXform.position -leftEyeDist playerEyeCenterXform.right; playerRightEyeXform.position = playerEyeCenterXform.position +rightEyeDist playerEyeCenterXform.right;
Found how to properly fix this bug. Issue is in unity-xr-plugin. More info here: https://github.com/ValveSoftware/unity-xr-plugin/issues/86#issuecomment-930095636
XR method device.TryGetFeatureValue(inputFeatureUsage, out position) returns wrong left and right eye position Y and Z coordinates when using XR OpenVR plugin. Tested with versions 2.7.1 and 2.7.2 No matter how I rotate and tilt headset Left and Right eye YZ coords always stays same and equal to Center Eye YZ coordinates. Issue does not appear when using Legacy VR system, only happens after switching project to XR plugin. Not sure if this is Unity issue or SteamVR plugin issue. Issue exists in Unity 2019.4.18f1, 2020.2.2f1 and 2021.1.0b4
Method code that can be used for testing:
Attached two screenshots. First screenshot shows how values should look - this screenshot taken from project using Legacy VR system. Second screenshot shows what I get after switching to XR plugin.