cancel
Showing results for 
Search instead for 
Did you mean: 

Minor fixes for the Oculus Integration 28

DarkTable
Level 5

Here are a couple of issues that have been floating around for a while. It would be great to not have to apply these patches every time I upgrade the Oculus Integration. It would also be great if there was a way to do pull requests on the integration, because there's more.

 

When you're using hand tracking, the pointer pose objects are just anonymously named, but they're very important objects that should be named according to their purpose (also, there should be a public getter for HandType.Left/Right):

diff --git a/VR/Scripts/Util/OVRHand.cs b/VR/Scripts/Util/OVRHand.cs
index 901fc68984c9b9b986c87b10e7aee5c770daeb61..43fa39aa568db16b72ea690c9809170b54720c51 100644
--- a/VR/Scripts/Util/OVRHand.cs
+++ b/VR/Scripts/Util/OVRHand.cs
@@ -63,7 +63,7 @@ public class OVRHand : MonoBehaviour,
 
    private void Awake()
    {
+       // so we don't have two anonymous "GameObject"s when using hands.
-       _pointerPoseGO = new GameObject();
+       _pointerPoseGO = new GameObject($"{nameof(PointerPose)}_{HandType}");
        PointerPose = _pointerPoseGO.transform;
        if (_pointerPoseRoot != null)
        {

 

When you're using the OVRControllerHelper to show the controller models, the wrong controller is displayed when using the Quest 2 Link feature.

diff --git a/VR/Scripts/Util/OVRControllerHelper.cs b/VR/Scripts/Util/OVRControllerHelper.cs
index d3c40ec681888e0adbe41fb8d1e56dac0fd2bca0..2bfac114cda776d9d1470efc1abf8f084dba2dcf 100644
--- a/VR/Scripts/Util/OVRControllerHelper.cs
+++ b/VR/Scripts/Util/OVRControllerHelper.cs
@@ -77,7 +77,6 @@ public class OVRControllerHelper : MonoBehaviour
            case OVRPlugin.SystemHeadset.Rift_CV1:
                activeControllerType = ControllerType.Rift;
                break;
+           // so correct controller appears when using Quest2 link
+           case OVRPlugin.SystemHeadset.Oculus_Link_Quest_2:
            case OVRPlugin.SystemHeadset.Oculus_Quest_2:
                activeControllerType = ControllerType.Quest2;
                break;

 

1 REPLY 1

DarkTable
Level 5

Another thing I've noticed with the Oculus Integration is that indentation of blocks will change between tabs and spaces, probably depending on which engineer was the last to touch the file. It would be cool if an .editorconfig file was added to enforce a standard. 🤞