Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Completely Disable Rotation Tracking

Discussion in 'AR/VR (XR) Discussion' started by Wallawocko, Nov 15, 2016.

  1. Wallawocko

    Wallawocko

    Joined:
    Nov 1, 2015
    Posts:
    25
    On the Samsung Gear VR (Oculus Unity)

    Hey everyone,

    Looking to find a way to disable head tracking for a period of time. I know, it may disorient the user. Its something that needs to happen for my application, and I know there are a ton of others that have been looking for this functionality..

    Anyone have an idea on how this can be done?
    - Making objects/terrain in the scene a child of the camera causes stuttering
    - OVRManager.positionTracking = false does not stop rotation

    Any working methods? Unity 5.4.2f
     
    Last edited: Nov 15, 2016
    demid likes this.
  2. Martinez-Vargas

    Martinez-Vargas

    Joined:
    Jun 24, 2016
    Posts:
    39
    Hello Friend.
    In the OVRCamera Rig script, lines of code will appear as the image, if you disable these lines the camera will not rotate with the head, you can put those lines of code in a bool, if the bool is true the camera rotation is true, yes The bool is false, the rotation of the camera is false.
     

    Attached Files:

    • eyes.PNG
      eyes.PNG
      File size:
      9.6 KB
      Views:
      1,332
  3. Wallawocko

    Wallawocko

    Joined:
    Nov 1, 2015
    Posts:
    25
    That is how I implemented this pre-Unity 5.1 which now has built in VR support.

    New versions of Unity have the OVRCameraRig Now looking like my attached image. It depends on the VR.InputTracking to get its rotation.

    Additionally, even if i comment it out, the device still tracks rotation. I assume cause the VR Settings are over-riding the OVRCameraRig?
    Anyone have any idea?

    upload_2016-11-18_10-32-16.png
     
  4. Wallawocko

    Wallawocko

    Joined:
    Nov 1, 2015
    Posts:
    25
    I was able to kinda get what i'm looking for by using this approach:
    Parent the camera under another object, and set that object's position to the negative of the VR head position. You can use VR.InputTracking.GetLocalPosition to query for the position of the head node, then set this parent node to have the negative of that value.


    However, this is a significant caluclation, and involves the camera moving, then re-moving, and causes the HMD to stutter a bit and lag.
    It would be much better to never do the movement at all...

    Any additional ideas?
    Thanks!
     
    demid likes this.
  5. demid

    demid

    Joined:
    Mar 20, 2012
    Posts:
    9
    Wallawocko, I'm struggle with the same task for several days now with no luck so far. I'm using Unity 5.5.1 + Oculus Unity Utilities 1.10.0.

    With the mentioned solution to update rotations and positions with inverse values generally works, but when a HMD moves, the image is jittery while the FPS drops to as low as 30 which is unacceptable. Here I've shared a bit more details on Oculus forum:
    https://forums.oculus.com/community/discussion/comment/491677/#Comment_491677

    Does anybody have another solution for manual camera positioning and rotation while continuing to receive HMD pose updates for custom transform calculations?