Skip to main content
New Participant
July 19, 2013

Restricting Camera Rotation

Hi guys,

I'm developing a racing game using the Rift and just wondering if anyone has come up with an easy way of modifying the scripts to restrict the camera rotation (ie so that you cant fully look behind you or fully up/down).

I'm currently delving through the scripts to see if I can do it myself, but if anyone has come up with a solution already I'd love to hear it! (I'm guessing I'll have to play around with the SetCameraOrientation() function in OVRCamera.cs).
    This topic has been closed for replies.

    2 replies

    Inspiring
    July 20, 2013
    Hello there,

    Currently there is no way to disable camera rotation. However, this will be included in the next release; at this time you can go into OVRCamera.cs, look for OVRDevice.GetOrientation. The code looks like this:

    // Read shared data from CameraController
    if(CameraController != null)
    {
    // Read sensor here (prediction on or off)
    if(CameraController.PredictionOn == false)
    OVRDevice.GetOrientation(0, ref CameraOrientation);
    else
    OVRDevice.GetPredictedOrientation(0, ref CameraOrientation);
    }

    Simply wrap your condition to turn off reading the CameraOrientation here.

    FOr the next release, OVRCameraController.cs will include a new public bool variable EnableTracking. This can be used to toggle tracking on off.
    Peter Giokaris Senior Software Engineer
    btruslerAuthor
    New Participant
    July 22, 2013
    Thanks for the response Peter! Much appreciated!