Search Unity

What exactly does UnityEngine.VR.InputTracking.Recenter do?

Discussion in 'AR/VR (XR) Discussion' started by Dreamwriter, Aug 14, 2016.

  1. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    So, I'm trying to center the camera when the user presses a button in a sit-down Vive game, and nothing at all happens. I'm calling VR.InputTracking.Recenter. What exactly is it supposed to do? Do I need to setup something in advance, like tell it where I want the center to be? The docs aren't all that descriptive, except to say it doesn't work with room-scale experiences.
     
  2. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    After more research, it seems that maybe calling that is supposed to set the camera's X,Y,Z to 0,0,0, and rotation to Identity, which then allows your game to position it exactly where desired. I don't think it's working for me, though, its position seems kinda based on the user's height.
     
  3. Dreamwriter

    Dreamwriter

    Joined:
    Jul 22, 2011
    Posts:
    472
    Unity's VR.InputTracking.Recenter doesn't seem to work at all for me on the Vive no matter what I do. Here's what I had to do to get it working: first, put the [SteamVR] prefab in the scene, set it to a seated tracking universe, and then in my code call
    Code (CSharp):
    1. Valve.VR.OpenVR.System.ResetSeatedZeroPose ();
    It appears that Unity 5.4.0F3 doesn't do a ResetSeatedZeroPose in VR.InputTracking.Recenter when set to OpenVR.
     
  4. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    976
    I have this issue too. On oculus it works fine but Vive doesn't do anything with recenter.
     
  5. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    976
    I submitted a bug report (Case 824158).
     
  6. Fattie

    Fattie

    Joined:
    Jul 5, 2012
    Posts:
    476
  7. dvr7

    dvr7

    Joined:
    Apr 24, 2016
    Posts:
    34
    I think you have to put your camera at 0,0,0 and then put it inside another empty object. The empty object need to be positioned at whereever you normally position a camera