API reference
API reference
Select your platform
No SDKs available
No versions available

OVRCameraRig Class

Extends MonoBehaviour
This class is the core component of the OVRCameraRig prefab, which provides the transform object to represent the Oculus tracking space and the trackable objects.
It contains a tracking space game object to fine-tune the relationship between the head tracking reference frame and your world. It also contains a center eye anchor, which is the main Unity camera, two anchor game objects for each eye, and left and right hand anchors for controllers.

Protected Fields

_centerEyeCamera : Camera
Signature
Camera _centerEyeCamera
_leftEyeCamera : Camera
Signature
Camera _leftEyeCamera
_previousTrackingSpaceTransform : Matrix4x4
Signature
Matrix4x4 _previousTrackingSpaceTransform
_rightEyeCamera : Camera
Signature
Camera _rightEyeCamera
_skipUpdate : bool
Signature
bool _skipUpdate
centerEyeAnchorName : readonly string
Signature
readonly string centerEyeAnchorName
leftControllerAnchorName : readonly string
Signature
readonly string leftControllerAnchorName
leftControllerInHandAnchorName : readonly string
Signature
readonly string leftControllerInHandAnchorName
leftEyeAnchorName : readonly string
Signature
readonly string leftEyeAnchorName
leftHandAnchorDetachedName : readonly string
Signature
readonly string leftHandAnchorDetachedName
leftHandAnchorName : readonly string
Signature
readonly string leftHandAnchorName
leftHandOnControllerAnchorName : readonly string
Signature
readonly string leftHandOnControllerAnchorName
rightControllerAnchorName : readonly string
Signature
readonly string rightControllerAnchorName
rightControllerInHandAnchorName : readonly string
Signature
readonly string rightControllerInHandAnchorName
rightEyeAnchorName : readonly string
Signature
readonly string rightEyeAnchorName
rightHandAnchorDetachedName : readonly string
Signature
readonly string rightHandAnchorDetachedName
rightHandAnchorName : readonly string
Signature
readonly string rightHandAnchorName
rightHandOnControllerAnchorName : readonly string
Signature
readonly string rightHandOnControllerAnchorName
trackerAnchorName : readonly string
Signature
readonly string trackerAnchorName
trackingSpaceName : readonly string
Signature
readonly string trackingSpaceName

Fields

disableEyeAnchorCameras : bool
If true, the cameras on the eyeAnchors will be disabled.
Signature
bool disableEyeAnchorCameras
useFixedUpdateForTracking : bool
If true, all tracked anchors are updated in FixedUpdate instead of Update to favor physics fidelity.
Signature
bool useFixedUpdateForTracking
usePerEyeCameras : bool
If true, separate cameras will be used for the left and right eyes.
Signature
bool usePerEyeCameras

Properties

centerEyeAnchor : Transform
[Get]
Always coincides with average of the left and right eye poses.
Signature
Transform centerEyeAnchor
leftControllerAnchor : Transform
[Get]
Anchors controller pose to fix offset issues for the left hand.
Signature
Transform leftControllerAnchor
leftControllerInHandAnchor : Transform
[Get]
Coincides with the pose of the left controller when it is in a hand.
Signature
Transform leftControllerInHandAnchor
leftEyeAnchor : Transform
[Get]
Always coincides with the pose of the left eye.
Signature
Transform leftEyeAnchor
leftEyeCamera : Camera
[Get]
The left eye camera.
Signature
Camera leftEyeCamera
leftHandAnchor : Transform
[Get]
Always coincides with the pose of the left active input device.
Signature
Transform leftHandAnchor
leftHandAnchorDetached : Transform
[Get]
Coincides with the pose of the left input device if it is detached.
Signature
Transform leftHandAnchorDetached
leftHandOnControllerAnchor : Transform
[Get]
Coincides with the pose of the left hand when it is on a controller.
Signature
Transform leftHandOnControllerAnchor
rightControllerAnchor : Transform
[Get]
Anchors controller pose to fix offset issues for the right hand.
Signature
Transform rightControllerAnchor
rightControllerInHandAnchor : Transform
[Get]
Coincides with the pose of the right controller when it is in a hand.
Signature
Transform rightControllerInHandAnchor
rightEyeAnchor : Transform
[Get]
Always coincides with the pose of the right eye.
Signature
Transform rightEyeAnchor
rightEyeCamera : Camera
[Get]
The right eye camera.
Signature
Camera rightEyeCamera
rightHandAnchor : Transform
[Get]
Always coincides with the pose of the right active input device.
Signature
Transform rightHandAnchor
rightHandAnchorDetached : Transform
[Get]
Coincides with the pose of the left input device if it is detached.
Signature
Transform rightHandAnchorDetached
rightHandOnControllerAnchor : Transform
[Get]
Coincides with the pose of the right hand when it is on a controller.
Signature
Transform rightHandOnControllerAnchor
trackerAnchor : Transform
[Get]
Always coincides with the pose of the sensor.
Signature
Transform trackerAnchor
trackingSpace : Transform
[Get]
Provides a root transform for all anchors in tracking space.
Signature
Transform trackingSpace

Events

TrackingSpaceChanged : Action< Transform >
Occurs when the trackingSpace's transform changes.
This event provides a single argument: the Transform of the tracking space. This is the same as the trackingSpace property.
Signature
Action<Transform> TrackingSpaceChanged
UpdatedAnchors : System.Action< OVRCameraRig >
Occurs when the eye pose anchors have been set.
Signature
System.Action<OVRCameraRig> UpdatedAnchors

Protected Methods

Awake ()
Signature
virtual void Awake()
Returns
void
CheckForAnchorsInParent ()
Signature
void CheckForAnchorsInParent()
Returns
void
CheckForTrackingSpaceChangesAndRaiseEvent ()
Checks for changes to trackingSpace's transform and, if it has changed, raises the TrackingSpaceChanged event.
This method compares the trackingSpace transform's localToWorldMatrix matrix against its value during the last invocation of this method.
If trackingSpace is null, this method has no effect.
Signature
virtual void CheckForTrackingSpaceChangesAndRaiseEvent()
Returns
void
ConfigureAnchor ( root , name )
Signature
virtual Transform ConfigureAnchor(Transform root, string name)
Parameters
root: Transform
name: string
Returns
Transform
FixedUpdate ()
Signature
virtual void FixedUpdate()
Returns
void
OnBeforeRenderCallback ()
Signature
virtual void OnBeforeRenderCallback()
Returns
void
OnDestroy ()
Signature
virtual void OnDestroy()
Returns
void
RaiseUpdatedAnchorsEvent ()
Signature
virtual void RaiseUpdatedAnchorsEvent()
Returns
void
Start ()
Signature
virtual void Start()
Returns
void
Update ()
Signature
virtual void Update()
Returns
void
UpdateAnchors ( updateEyeAnchors , updateHandAnchors )
Signature
virtual void UpdateAnchors(bool updateEyeAnchors, bool updateHandAnchors)
Parameters
updateEyeAnchors: bool
updateHandAnchors: bool
Returns
void

Methods

ComputeTrackReferenceMatrix ()
Signature
virtual Matrix4x4 ComputeTrackReferenceMatrix()
Returns
Matrix4x4
EnsureGameObjectIntegrity ()
Signature
virtual void EnsureGameObjectIntegrity()
Returns
void