- About XR
- XR Unity SDK
- XR SDK Release Notes
- Version:1.0.3
- Version:1.0.2
- Version:1.0.1
- Version:1.0.0
- Version:0.9.59
- Version:0.9.58
- Version:0.9.57
- Version:0.9.56
- Version:0.9.55
- Version:0.9.54
- Version:0.9.53
- Version:0.9.52
- Version:0.9.51
- Version:0.9.38
- Version:0.9.37
- Version:0.9.34
- Version:0.9.33
- Version:0.9.32
- Version:0.9.31
- Version:0.9.30
- Version:0.9.24
- Version:0.9.23 Beta
Sample - Migration from Oculus¶
Contents
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.
We use the Oculus’s DebugUI sample to migration.
Replace Oculus camera and controller component
Remove Oculus OVRPlayerController
Add XR prefabs: XRManager and XRController
Remove Oculus raycast component - OVRRaycaster
Modify script - HandedInputSelector.cs
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()
public void Awake()
{
...
if (GetComponent<OVRRaycaster>()) GetComponent<OVRRaycaster>().pointer = lp.gameObject;
...
}
Modify script - DebugUIBuilder.cs - Show()
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.
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 |