This website uses cookies to improve our services and deliver relevant ads.
By interacting with this site, you agree to this use. For more information, see our Cookies Policy
This document provides an overview of new features, improvements, and fixes included in the Oculus Unity Integration that shipped with version 0.4 of the Oculus Mobile SDK.
If you are developing with Unity, we recommend updating to Unity 4.6.1, which contains Android 5.0 – Lollipop support.
We would like to highlight the inclusion of the new Mobile Unity Integration with full DK2 support based on the Oculus PC SDK 0.4.4. As this is a significant API refactor, please refer to the Unity Development Guide: Migrating From Earlier Versions section for information on how to upgrade projects built with previous versions of the Mobile Unity Integration.
Added support for Android 5.0 (Lollipop) and Unity Free.
First public release of the Oculus Mobile SDK.
The 0.4.3+ Unity Integration’s API is significantly different from prior versions. This section will help you upgrade.
The following are changes to Unity components:
| OVRDevice → OVRManager | Unity foundation singleton. |
| OVRCameraController → OVRCameraRig | Performs tracking and stereo rendering. |
| OVRCamera | Removed. Use eye anchor Transforms instead. |
The following are changes to helper classes:
| OVRDisplay | HMD pose and rendering status. |
| OVRTracker | Infrared tracking camera pose and status. |
| OVR.Hmd → Ovr.Hmd | Pure C# wrapper for LibOVR. |
The following are changes to events:
| HMD added/removed | Fired from OVRCameraRig.Update() on HMD connect and disconnect. |
| Tracking acquired/lost | Fired from OVRCameraRig.Update() when entering and exiting camera view. |
| HSWDismissed | Fired from OVRCameraRig.Update() when the Health and Safety Warning is no longer visible. |
| Get/Set*(ref *) methods | Replaced by properties. |
To upgrade, follow these steps:
OVRCameraController -> OVRCameraRig
cameraController.GetCameraPosition() -> cameraRig.rightEyeAnchor.position
cameraController.GetCameraOrientation() -> cameraRig.rightEyeAnchor.rotation
cameraController.NearClipPlane -> cameraRig.rightEyeCamera.nearClipPlane
cameraController.FarClipPlane -> cameraRig.rightEyeCamera.farClipPlane
cameraController.GetCamera() -> cameraRig.rightEyeCamera
----------------------------------------------------------------------
if ( cameraController.GetCameraForward( ref cameraForward ) &&
cameraController.GetCameraPosition( ref cameraPosition ) )
{
...
to
if (OVRManager.display.isPresent)
{
// get the camera forward vector and position
Vector3 cameraPosition = cameraController.centerEyeAnchor.position;
Vector3 cameraForward = cameraController.centerEyeAnchor.forward;
...
----------------------------------------------------------------------
OVRDevice.ResetOrientation();
to
OVRManager.display.RecenterPose();
----------------------------------------------------------------------
cameraController.ReturnToLauncher();
to
OVRManager.instance.ReturnToLauncher();
----------------------------------------------------------------------
OVRDevice.GetBatteryTemperature();
OVRDevice.GetBatteryLevel();
to
OVRManager.batteryTemperature
OVRManager.batteryLevel
----------------------------------------------------------------------
OrientationOffset
Set rotation on the TrackingSpace game object instead.
----------------------------------------------------------------------
FollowOrientation
----------------------------------------------------------------------
FollowOrientation is no longer necessary since OVRCameraRig applies tracking
in local space. You are free to script the rig’s pose or make it a child of
another Game Object.