Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Using Google VR Head Tracking without activating VRMode

Discussion in 'AR/VR (XR) Discussion' started by Bibzball, Jul 21, 2017.

  1. Bibzball

    Bibzball

    Joined:
    Sep 26, 2015
    Posts:
    21
    Hi,

    Out of all sensor fusion algorithms I've seen on the web, GVR's Head Tracking is by far the best and most precise sensor fusion algorithm on smartphone I could find.

    It is so much better that I am trying to do something that might seem weird: I want to have access to
    Code (CSharp):
    1. VR.InputTracking.GetLocalRotation
    without having either stereoscopic view, landscape mode forced or my view automatically rotating : I just need to access the quaternion.

    I only managed to get GetLocalRotation to work if I first load the cardboard device

    Code (CSharp):
    1. VRSettings.LoadDeviceByName("cardboard");
    But as soon as I do this:
    - The whole scene rotates with my device
    - Landscape mode is forced

    Do I have to write my own plugin using Google Native SDK to achieve this?

    Thanks!
     
  2. joejo

    joejo

    Unity Technologies

    Joined:
    May 26, 2016
    Posts:
    705
    This is not possible today. If you load a Google VR device and don't enable VR, that device then owns the main camera and rotations will track with the pose. This is an explicit feature from Google calls Magic Mirror Mode and you can not opt out of it.
     
  3. dustinkerstein

    dustinkerstein

    Joined:
    Jan 26, 2017
    Posts:
    12
    Hey joejo, do you know if there are any plans to change this?

    I'm trying to build a single app that handles Daydream, Cardboard, and Magic Window, but the current restrictions in GVR / Unity prevent this from being possible without UX issues (ex. daydream view interstitial popping up even when VRSettings.enabled = false). See this post of mine on GitHub:

    https://github.com/googlevr/gvr-unity-sdk/issues/703
     
  4. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    616
    I use Google Cardboard SDK v0.6 to get a VR view without needing any native VR mode or additional Google VR services or apps installed on the device. I also have control over phone's orientation.
     
  5. MUGIK

    MUGIK

    Joined:
    Jul 2, 2015
    Posts:
    158
    What's the version of your Unity Editor? Because I work with Unity 2017.1 and afraid that there is no way to use old GVR SDKs with newest Editors.
    Thank!
     
  6. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    616
unityunity