Search Unity

Question Quest 2 quardian to unity rotation?

Discussion in 'VR' started by Innovine, Nov 18, 2022.

  1. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    What is it that sets the initial mapping between the guardian space forward direction, and the unity worldspace forward direction?
    I am using an Oculus Quest 2 connected with a link cable. When I run my game I get somewhat random rotation from what the headset guardian forward vector currently is, and what the unity world Z is.

    Any advice on how to get a better understanding of how this works? When my camera in-game is showing a unity rotation of 0,0,0, what and where is the relationship between this orientation and the guardian orientation?
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,055
    From my experience the unity forward is the viewing direction of the player when the game starts
     
    JoeStrout likes this.
  3. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    I'm not so sure about that. I can keep my headset pointing forward and restart the game a few times and it still produces odd rotations when the game starts. I notice that the grid shown on the floor of the link screen (when the world is grey with a black grid on the floor) that this orientation can change at times, but how this affects unity is unknown to me
     
  4. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    C'mon, someone must know which way the headsets points, surely??
     
  5. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    bump, does no one know what sets the headset forward direction??? Unity, answer please!
     
  6. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Still need some info on this
     
  7. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,055
    I already gave an answer. You can also check out stage mode tracking in oculus xr plugin 3.1+
     
  8. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Well, that may work for you, but it is clearly not the case for me. It is not an entirely random angle between the guardian forward and the unity scene Z forward, but it is somewhat unpredictable.
     
  9. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,055
    Did you check stage mode tracking? That seems to make the position to the guardian relative
     
  10. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    Isn't that for Android? It's listed under Android on this page: https://docs.unity3d.com/Packages/com.unity.xr.oculus@3.1/manual/index.html however I dont see any other mentions of it anywhere else, so it's a bit of a mystery how one would use it or what exactly it does. Stage isnt listed as a valid mode according to this page: https://docs.unity3d.com/2022.2/Documentation/ScriptReference/XR.TrackingOriginModeFlags.html

    Either way, it doesn't seem relevant for my use case though..
    Do you know of any further docs on this?
     
  11. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,055
    Don't think there is any cross platform solution yet, except for when you start that's the forward of the camera.
    If you need more precise data you need custom tracking or headset setup (eg recenter while looking in the desired way). Or maybe try to get the guardian points and do something with this, but seems like a big undertaking, especially if cross platform