[Oculus DK2] when virtual reality enabled, I want to disable HMD tracking

Is there HMD tracking off option?
What I want is that view is not chaged even when there is VR movement.

Thank you in advance.

Unfortunately, “For now you must use Oculus’ SDK in order to obtain the movement volume or lock movement. This will be exposed through Unity in the future.”.

Quote taken from Unity - Manual: VR development in Unity

so if you’re using Unity’s VR then you cannot lock movement as of right now.
but if you’re still using the OVR integration plugins, you can, it’s a setting on their Manager.

Not sure what you would use that for, but a word of caution as doing so will make the user uncomfortable.

Controlling where the camera actually is is pretty essential to a lot of/MOST games. Tuning these effects seems to be quite essential.

Yeah, but doing so on an HMD is not a comfortable experience.

You can control the camera when VR is enabled if you make it a child or another object and then move the parent object. Doing this will not make the user feel uncomfortable so long as the user is not moving around in real space.

Restricting HMD tracking will however make the user feel very uncomfortable because they will move their head, but the image they are seeing will not shift in any way. Doing this with an image that is not black will cause a lot of discomfort.

I agree, it would not feel good for the user, but if you still want to do this. Add a script to the parent object of the camera that counteracts the movement of the camera from the sensor. read the camera transform values. if it moves up, move the parent down with the same amount… same with rotation… Not an ideal way to do it but it will work.

Doesn’t this need to be tunable though? ie how far the camera moves when someone moves their head. This should be adaptable to the scale of the scene. Like what do you do during a cutscene where the camera is not supposed to move? How do you stop people from poking their head’s through walls?

Using the Parent object of the Camera, you can control the scale, position and rotation of the Camera. This allows you to adapt the camera to the scene like you suggest. If you scale the parent down, the camera will move less with the head tracking relative to the rest of the world. If you scale it up, the camera will move more relative to the world.

I can think of a few cut scene examples in which position tracking might not be desired, but even in the examples I can think of, the scene would not be setup in a way in which the user could “poke their head’s through walls” as you suggest.

For example a scene in which the player is captive. Maybe similar to the first scene of The Elder Scrolls: Skyrim, if you have played that. In this scene, the user should be able to rotate and move their head slightly as if leaning and looking around the world. And at no point in this cut scene would the player be able to move their head through a wall.

Another example, a cut scene where the camera is flying over a town or village and the user can look around to see different area’s of the village, or something similar, maybe the camera is flying through a dungeon showing the user the path ahead. In both instances, maybe the camera wouldn’t need positional tracking, but even if the positional tracking was present, the camera would never be positioned in such a way that it would go through another object or wall.

I can understand why you might not necessarily need positional tracking in all cases, but removing it all together can make the user feel sick. So as a best practice, your world would be designed with that in mind.

If you have a really good example scene or scenario in which positional and rotational tracking wouldn’t be used, I would be interested to hear. We are open to adding functionality, but we want to keep in mind the best practices for VR so that it isn’t easy to make the user feel uncomfortable by accident.

Apparently you can disable it with this:
https://developer.oculus.com/downloads/game-engines/0.1.0-beta/Oculus_Utilities_for_Unity/

Dear Unity-Ppl
You are making an engine. Not gameplay-decisions and not best-practice rules for us!
Stop that at once!!!
Open every aspect of it so we can code what ever we want, like it should be. Nobody has to justify anything to you.

2 Likes

I have a use… I have two cameras in my game, one camera I need to have head tracking and the other camera I need the head tracking disabled… the camera where there is head tracking is what the player sees (so they can look around the environment) and the other I am using for a raycasting and I DON’T want it to move when the player moves their head… has there been a recent development and is there a way to disable head movement from a camera in the updated unity? Thank you!

I have to agree with float although I would not put it that radically :smiley:

I mean in regular 3D games camera shakes are not the nicest thing to do to an player either, but still you wouldn’t want the engine make the decision for you.

I can think of many ways where freezing the pos-tracker could be useful. I’ve seen this being requested for quite some time now. I have personally a case where I want the player to start of with a static image of the scene which explains a few things, but now I have to render it in to a texture …

What about a game where you make photographs as freeze frames? Yes I totally understand your worries about the comfort of our players but last time I checked this was our job, no?

Or a POV game where your mafia boss grabs your head and points it directly at his face. Yeah probably weird to be forced to look into a direction that you are not really looking at, but maybe that is the intended feeling. Who knows? Give us the possibility to find out and maybe fail.

Last but not least here the craziest use case ever: I don’t put on the glasses every 5 seconds when I want to test something. Sometimes I forget to direct the glasses on my desk to the front and I see nothing (the floor). Wish I had a toggle to disable the tracking ingame, so I wouldn’t need to care about how the glasses lay around on my desk. Yes I could always dig down to the settings and disable VR but this decision does more than intended.

Anyhow we can all agree the the whole VR things is pretty new to all of us and I’m totally on Unity’s side when it comes to best practices to keep people healthy. Just I wouldn’t make technical restrictions to enforce it. You never know how and for what people use the hardware.

Btw. thanks for the hard work that has been done in 5.1 for VR. We are on a project with a tight deadline and every week I feel a bit better.

1 Like

I have a simulation where I use other trackers for full body motion, including the head. Not being able to turn off Oculus’ tracking is making this a real pain. Please let us do it!

2 Likes

Seconding this as a problem for testing alternative hardware tracking.

1 Like

I work in a motion capture lab at the Ohio State University’s Advanced Computing Center for the Arts and Design and we came up against the same problem that RyuHayaboosa mentioned. Our Vicon motion capture system was taking care of position/rotation tracking (piped in to Unity via Vicon’s Pegasus software). The built in Unity VR was adding to and disrupting our mocap rotations.

We tried:

  1. Disabling rotations from Vicon and just using Oculus rotations. Gryoscope/accelerometer data drifts, which caused loss of reliable user to virtual environment orientation.
  2. Parenting a quad with a render texure of the motion capture camera to the Oculus camera, but there were distortions when the Oculus rotated on the z axis.
  3. Zeroing out position and rotation in LateUpdate(), but that seemed to have no effect at all.
  4. We ended up disabling Unity VR, downgrading the Oculus runtime to 0.6.1.0 so we could use Extended Display Mode, and used Google Cardboard’s SDK to create a stereoscopic display.

Being able to disable rotation/position tracking would have made this much simpler.

1 Like

The Sixense SDK uses their trackers instead of the Oculus ones so it is possible.

Since this is the top result when searching for disabling oculus position tracking in Unity, and I was looking for this exact thing:
It’s now possible to disable position tracking with the latest Unity editor (5.3.4p1 - 5.3.4p4), Oculus SDK 1.3 with the updated OVRPlugin and Oculus Utilities for Unity (not necessary, but easier). See this post for more information on that.

You’ll have to use the OVRCameraRig Prefab provided by Oculus Utilites and turn off Use Position Tracking to… well, turn off position tracking. This’ll keep the camera in one place, but keeps orientation tracking intact. You can turn off rotation tracking by digging into the provided scripts a little.

Alternatively, one can use this script to disable both without the Oculus Utilities:

    [DllImport("OVRPlugin", CallingConvention = CallingConvention.Cdecl)]
    private static extern int ovrp_SetCaps(int caps);

    void Start()
    {
        // disable position tracking
        ovrp_SetCaps(14);
        // disable rotation tracking
        ovrp_SetCaps(6);
    }

Edit: Just noticed, disabling rotation tracking will cause Oculus to display unity’s scene as a floating 2D window, so if you look around you’ll see black space. Probably needs another solution to disable rotation.

Edit2: Adding

trackingSpace.FromOVRPose(centerEyeAnchor.ToOVRPose(true).Inverse());

at the end of OVRCameraRig.cs / UpdateAnchors() from the Oculus Utilities knocks out orientation, too. There’s a slight wobble in the Editor window, but it was barely (it at all) noticeable in the DK2. Taken from here

1 Like

Wouldn’t it be easier to just make the camera that you don’t want to move a child of an empty OBJ. Then on the parent OBJ and a script to counter the rotation of the head. (I use this and it works)

//Requires using UnityEngine.VR

Quaternion startRot;
    Quaternion HeadRot;


    // Use this for initialization
    void Start () {
        startRot = transform.rotation;


    }
   
    // Update is called once per frame
    void Update () {
   
        transform.rotation = startRot * Quaternion.Inverse (InputTracking.GetLocalRotation (VRNode.CenterEye));

    }
1 Like

I have another use case: I have two displays - one for the person wearing the Oculus HMD and one for multiple people who are viewing the scene on a second monitor. I want the people viewing from the second monitor to not be affected by the HMD wearer’s head motion. Even if I use multiple displays and set the target eyes appropriately, the HMD rotation still affects the second display!
I’ve tried the inverse option that Rogue_Guardian_Studios recommends, but there is clearly some synchronicity problem. Every time the HMD is moved there is judder in the other display.
Any ideas?