XRSPACE Developer Console

Sample - Migration from Oculus

Introduction

The Oculus project can easy to migration to XR project.

In this sample, we will demonstrate how to migrate Oculus project to XR-SDK project, just change some gameObjects and modify some script.

How to Migrate

Open the DebugUI sample.

../_images/Oculus’s DebugUI sample.png

We use the Oculus’s DebugUI sample to migration.

  • Replace Oculus camera and controller component

    • Remove Oculus OVRPlayerController

    • Add XR prefabs: XRManager and XRController

../_images/Migration-DebugUI-Oculus-removeOPC.png
  • Remove Oculus raycast component - OVRRaycaster

../_images/Migration-DebugUI-Oculus-removeOVRaycaster.png
  • Modify script - HandedInputSelector.cs

../_images/Migration-DebugUI-Oculus-mdfHS.png
void SetActiveController(OVRInput.Controller c)
{
        if (m_CameraRig == null)
        return;
        Transform t;
        if(c == OVRInput.Controller.LTouch)
        {
                t = m_CameraRig.leftHandAnchor;
        }
        else
        {
                t = m_CameraRig.rightHandAnchor;
        }
        m_InputModule.rayTransform = t;
}
  • Modify script - DebugUIBuilder.cs - Awake()

../_images/Migration-DebugUI-Oculus-mdfDUB.png
public void Awake()
{
...
if (GetComponent<OVRRaycaster>())  GetComponent<OVRRaycaster>().pointer = lp.gameObject;
...
}
  • Modify script - DebugUIBuilder.cs - Show()

../_images/Migration-DebugUI-Oculus-mdfShow.png
public void Show()
{
        Relayout();
        gameObject.SetActive(true);
        if (rig != null)
        {
                transform.position = rig.transform.TransformPoint(menuOffset);
                Vector3 newEulerRot = rig.transform.rotation.eulerAngles;
                newEulerRot.x = 0.0f;
                newEulerRot.z = 0.0f;
                transform.eulerAngles = newEulerRot;
        }
...
}

And end this editor, below is the changed result.

../_images/Migration-DebugUI.png

Compare

The following is a comparison of Oculus and XR.

Item / System

XR

Oculus

Chip

sdm845

sdm835

FOV

100

100

FPS

90

72

Cross-platform

O

O

6 DoF / 3 DoF Heatset

O

O

Fixed Foveation

O

O

6 DoF / 3 DoF Controller

O

O

Hand Motion

O

X

TimeWarp

O

O

Boundary System

O

O

Simulator & Debug on PC

O

X