Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums will be revoked at the discretion of Oculus staff.
New to the forums? Click here to read the How To guide. -- Developers click here.

Multiple OVRCameraRigs

jamesjblahajamesjblaha Posts: 1
NerveGear
I have a Scene with 3 objects, each of which contains a bunch of stuff and it's own camera. Originally I just had 3 cameras, no OVR scripts on them, and when I turn far enough I disable one of the objects and enable another one, so when you turn past a certain point it switches scenes. This was all working fine until I wanted to add Touch controls.

I added OVRManager to an object that is always on, and each camera got an OVRCameraRig. If they each have their own TrackingSpace, or if I move the TrackingSpace on switch, the forward direction of the controllers is off by 120 degrees (the amount I rotated). I want to either totally reset the tracking when I switch, or move over my TrackingSpace and reset the forward direction to line it up with the new camera. I've gotten pretty close, by moving the tracking space and then disabling/enabling OVRManager with ResetTrackerOnLoad checked. The controllers work, they are in roughly the right place, but they move along with my head when they shouldn't.

Is there a better way to do this that still let's me keep the separate cameras? The cameras all have different scripts/settings etc. so I don't want to use a single one if I can avoid it.
Tagged:

Comments

  • imperativityimperativity Posts: 3,587 Valuable Player
    edited August 2018
    Hi,

    Welcome to the Oculus Developer Forums.

    Our OVRCameraRig script was not intended to be used multiple times in a scene.

    From the documentation on our Unity Utilities below:

    OVRCameraRig

    OVRCameraRig is a custom VR camera that may be used to replace the regular Unity Camera in a scene. Drag an OVRCameraRig into your scene and you will be able to start viewing the scene.

    The primary benefit to using OVRCameraRig is that it provides access to OVRManager, which provides the main interface to the VR hardware. If you do not need such access, a standard Unity camera may be easily configured to add basic VR support; see Unity VR Support for more information.

    Note: Make sure to turn off any other Camera in the scene to ensure that OVRCameraRig is the only one being used.


    And the reason for why you are experiencing the behavior with the controllers:


    OVRCameraRig contains one Unity camera, the pose of which is controlled by head tracking; two “anchor” Game Objects for the left and right eyes; and one “tracking space” Game Object that allows you to fine-tune the relationship between the head tracking reference frame and your world. The rig is meant to be attached to a moving object, such as a character walking around, a car, a gun turret, et cetera. This replaces the conventional Camera.


Sign In or Register to comment.