Skip to main content
Up and Coming
December 3, 2014

How to reset camera perspective of rift using unity?

Hi there,

I want to reset the camera perspective with a certain key. I am currently using the following code but several problems occured:

public class ResettingView : MonoBehaviour {

private OVRDevice ovrdevice ;

void Update()
{
if (Input.GetKeyDown ("Keycode.V))
{
OVRDevice.ResetOrientation (0);
}
}
}


It does not recognise OVRDevice nor ResetOrientation, so I guess it has been renamed in the updated extension (the update that was released for using the rift with the free version of unity).
What library do I have to include to be able to use OVRDevice?Within the current OVR folder I could not find a function or class that fitted ResetOrientation. All I could find was OVRManager.capiHmd.RecenterPose().

Can you help me on either using the function above or explain to me what function I have to use instead?

Thanks a lot!
    This topic has been closed for replies.

    2 replies

    Inspiring
    December 3, 2014
    The code to reset/recenter the orientation is like this:

    if (Input.GetKeyDown (KeyCode.Alpha7))
    OVRManager.display.RecenterPose();
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    gabrieadAuthor
    Up and Coming
    December 4, 2014
    Thanks that does the job!