Search Unity

InputTracking.Recenter() and vertical "centering"

Discussion in 'AR/VR (XR) Discussion' started by Metron, Feb 22, 2017.

  1. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    So, basically what I'm looking after is this:

    In my application the user can take any position he wants. In fact, quite often he might be lieing in his bed.

    My scene is set up so that the camera is facing front when I look forward normally.

    Thing is, when you lie in you bed, you still want to face the camera forward into the world.

    InputTracking.Recenter() should be the right function to achieve this, but unfortunately, it only seems to adjust the horizontal alignement. The vertical alignment is not taken into account.

    Any idea how to get this working?
     
  2. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    anyone?
     
  3. DrBlort

    DrBlort

    Joined:
    Nov 14, 2012
    Posts:
    72
    Use a hierarchy of empty GameObjects and make the camera a child. Then rotate and move the GameObjects as you wish. I've used it and it works well.
    EDIT: You may want to make the whole world a child of that hierarchy too.
     
  4. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    1,137
    Finally that's what I've done after I posted the question. Implemented an automatic and manual recalibration...
     
  5. yulong_zhang

    yulong_zhang

    Joined:
    Nov 2, 2016
    Posts:
    1
    Could you please share your method?
     
  6. Sometimes_Always_Never

    Sometimes_Always_Never

    Joined:
    Apr 5, 2014
    Posts:
    28
    Hey there, I know this was a while ago but I'm running into the same issue. I want to implement a "lying-down" mode for my Oculus Quest app, but seems the camera only wants to recenter horizontally and not vertically. If you remember could you say how you accomplished this? Thanks!