Skip to main content
Up and Coming
May 20, 2013

how to reset the view?

When the game starts the Rift is assuming the current position is the start position.

I would like to be able to override that in case you started at a bad position. But I am not sure what to call to do that. How can I reset the view?
    This topic has been closed for replies.

    20 replies

    Up and Coming
    November 23, 2013
    The method signature is
    public static bool ResetOrientation(int sensor)


    It is a static method and should be accessed in a static way. OVRDevice.ResetOrientation(0);
    Up and Coming
    November 27, 2013
    How can OVRDevice be accessed from JavaScript--with #prgama strict (no dynamic typing)?

    Can it be done without moving the Oculus stuff into Standard Assets? (I want to avoid that for future-proofing/version upgrades, and just for sensible project organization.)

    This fails for me with "'OVRDevice' does not denote a valid type":
    private var OVRref : OVRDevice;


    This fails the same way (with OVRController specified in the Inspector):
    var VRController : GameObject;
    private var OVRref : OVRDevice = VRController.GetComponent(OVRDevice);


    (I've Googled some links that seem to talk about making Unity compile C# before JS, but the links point to a missing docs page.)
    — Morgan — Mac OS X ❆ Unity
    Up and Coming
    November 28, 2013
    "AdamsImmersive" wrote:
    How can OVRDevice be accessed from JavaScript--with #prgama strict (no dynamic typing)?

    Can it be done without moving the Oculus stuff into Standard Assets? (I want to avoid that for future-proofing/version upgrades, and just for sensible project organization.)


    No you will need to move the OVR folder into the Standard Assets or Plugins folder. When you update to a new version of OVR integration, you will just need to move the folder again. It shouldn't cause too much pain.
    Up and Coming
    November 28, 2013
    "boone188" wrote:
    "AdamsImmersive" wrote:
    How can OVRDevice be accessed from JavaScript--with #prgama strict (no dynamic typing)?

    Can it be done without moving the Oculus stuff into Standard Assets? (I want to avoid that for future-proofing/version upgrades, and just for sensible project organization.)


    No you will need to move the OVR folder into the Standard Assets or Plugins folder. When you update to a new version of OVR integration, you will just need to move the folder again. It shouldn't cause too much pain.


    Cool. So in that case, when I import a new OVR package, and then drag it (using Unity, not the Finder!) into Standard Assets where the redundant old version resides, will it replace every file and sub-file and maintain all connections within my project? Not make a mess and break things? (Normally I'd re-import a newly-updated package while the original files are still in their default location: outside Standard Assets.)
    — Morgan — Mac OS X ❆ Unity
    Up and Coming
    November 28, 2013
    "AdamsImmersive" wrote:
    "boone188" wrote:
    "AdamsImmersive" wrote:
    How can OVRDevice be accessed from JavaScript--with #prgama strict (no dynamic typing)?

    Can it be done without moving the Oculus stuff into Standard Assets? (I want to avoid that for future-proofing/version upgrades, and just for sensible project organization.)


    No you will need to move the OVR folder into the Standard Assets or Plugins folder. When you update to a new version of OVR integration, you will just need to move the folder again. It shouldn't cause too much pain.


    Cool. So in that case, when I import a new OVR package, and then drag it (using Unity, not the Finder!) into Standard Assets where the redundant old version resides, will it replace every file and sub-file and maintain all connections within my project? Not make a mess and break things? (Normally I'd re-import a newly-updated package while the original files are still in their default location: outside Standard Assets.)


    Exactly. You will just need to drag and drop again. It will replace the old files and replace the prefabs in your scene.
    Up and Coming
    April 28, 2014
    I wanted two reset view options in my game:
    1) reset head to match body
    2) rotate body to match head

    The OVRDevice.ResetOrientation() works really well for #1.

    I am using the UFPS Camera in my project. So, for #2, I went with this:
    vp_FPSCamera.m_Yaw+=GameObject.Find("CameraLeft").transform.localRotation.eulerAngles.y;
    OVRDevice.ResetOrientation(0);

    Which works rather well. You look over somewhere besides forward, press a key and then forward is now the direction you were previously looking. Unfortunately, it does seem to render one frame of not what I want in the process. Not a deal breaker, but something I'd ditch if I knew how.
    August 26, 2014
    Can you exp[lain how you set these up? I would love to have both, I had reset set to R before using UFPS, but now it seems to be overridden. Thanks!
    Participant
    February 7, 2015
    "boone188" wrote:
    "AdamsImmersive" wrote:
    How can OVRDevice be accessed from JavaScript--with #prgama strict (no dynamic typing)?

    Can it be done without moving the Oculus stuff into Standard Assets? (I want to avoid that for future-proofing/version upgrades, and just for sensible project organization.)


    No you will need to move the OVR folder into the Standard Assets or Plugins folder. When you update to a new version of OVR integration, you will just need to move the folder again. It shouldn't cause too much pain.


    I have moved the OVR folder into the Standard Assets folder but I am still getting the problem described by AdamsImmersive:

    "AdamsImmersive" wrote:
    This fails for me with "'OVRDevice' does not denote a valid type":
    private var OVRref : OVRDevice;


    This fails the same way (with OVRController specified in the Inspector):
    var VRController : GameObject;
    private var OVRref : OVRDevice = VRController.GetComponent(OVRDevice);



    Is there something else I could be missing?
    Up and Coming
    February 16, 2015
    I couldn't get the good'ol OVRDevice.ResetOrientation() to work at all with the latest 0.4.4 SDK.

    After some digging around in the sdk, I found this:
    OVRManager.display.RecenterPose();


    Works for me. Hope it helps.
    Participant
    March 3, 2015
    I think something didn't update properly when I first moved the OVR folder. It's working fine now with it in StandardAssets and using the OVRManager.display.RecenterPose(); command.