
Unity | A Detailed Look at the Unity Integration | 11
This folder also contains the plugins for other platforms: OculusPlugin.bundle for MacOS; and Android/
libOculusPlugin.so, vrlib.jar, and AndroidManifest.xml for Android.
Prefabs
The current integration for adding VR support into Unity applications is based on two prefabs that may be added
into a scene:
• OVRCameraRig
• OVRPlayerController
To use, simply drag and drop one of the prefabs into your scene.
OVRCameraRig
OVRCameraRig replaces the regular Unity Camera within a scene. You can drag an OVRCameraRig into your
scene and you will be able to start viewing the scene with the Gear VR and Rift.
Note: Make sure to turn off any other Camera in the scene to ensure that OVRCameraRig is the only
one being used.
Figure 1: Prefabs: OVRCameraRig, expanded in the inspector
OVRCameraRig contains two Unity cameras, one for each eye. It is meant to be attached to a moving object
(such as a character walking around, a car, a gun turret, etc.) This replaces the conventional Camera.
The following scripts (components) are attached to the OVRCameraRig prefab:
• OVRCameraRig.cs
• OVRManager.cs
OVRPlayerController
The OVRPlayerController is the easiest way to start navigating a virtual environment. It is basically an
OVRCameraRig prefab attached to a simple character controller. It includes a physics capsule, a movement
system, a simple menu system with stereo rendering of text fields, and a cross-hair component.
To use, drag the player controller into an environment and begin moving around using a gamepad, or a
keyboard and mouse Note: Make sure that collision detection is active in the environment.
Comentarios a estos manuales