Search Unity

Unity UnityEngine.VR.GetLocalRotation without VR enable

Discussion in 'AR/VR (XR) Discussion' started by Orion_78, Jul 20, 2017.

  1. Orion_78

    Orion_78

    Joined:
    Feb 13, 2014
    Posts:
    66
    Hi

    Is there a way to retrieve the head rotation without activating the VR ?

    Thanks you very much
     
  2. Bibzball

    Bibzball

    Joined:
    Sep 26, 2015
    Posts:
    21
    Just realized I posted the same question. I'm interested in this as well.
     
  3. Orion_78

    Orion_78

    Joined:
    Feb 13, 2014
    Posts:
    66
  4. Orion_78

    Orion_78

    Joined:
    Feb 13, 2014
    Posts:
    66
    Ok, I finally managed to something terrible.

    I download the Cardboard API 0.5
    Then, I use a CardboardMain prefab, and set the Distortion correction to None
    I create after one update (yield return null) a new camera to replace to deactivated one from Cardboard API
    I can retrieve the gyroscope modification by following the Head from the CardboardMain prefab

    Good luck, tell me if you find better !

    Ps : I am using this technic in this app : http://lightgunmouse.com/
     
  5. Selzier

    Selzier

    Joined:
    Sep 23, 2014
    Posts:
    652
    I'm using Google Cardboard version 0.6 currently for a VR project. That's the best version as it's the highest version before Google changed over to GVR. So now I can make mobile VR games that don't require Unitys VR mode enabled or the Google VR services app downloaded on phone, and it's also possible to switch VR mode on and off without causing a crash.

    Orion, you should be able to just toggle Cardboard.SDK.VrModeEnabled true or false to turn VR on or off, you can still monitor rotation of CardboardHead.
     
  6. Orion_78

    Orion_78

    Joined:
    Feb 13, 2014
    Posts:
    66
    I experiencing a huge drift problem using this technique. Any idea to improve this ? Thanks