Skip to main content
Participant
August 23, 2015

Disabling Positional Tracking Not Functioning In Oculus Util

Hey,

I've been trying to upgrade to the Oculus Utilities 0.1.0 beta for Unity 5.1.1p3 or 5.1.2p3.
With the new integration, I've been having difficulty disabling positional tracking and only maintaining rotational tracking.

I tested this out with a new project that only had the Oculus Utilities asset imported and a cube close to the OVRCameraRig, to test if positional tracking is working. The only other changes are that "Virtual Reality Supported" Is turned on, and "Use positional tracking" in the OVRManager script is unchecked, which does not appear to have any effect.

In the previous Unity integration, I recall having to edit the OVRManager class to disable positional tracking, but I'm not certain how to make that same change with the new version.

I'm certain that positional tracking is still functioning, as I'm able to view the cube from above or below based on the position of the rift.

Any thoughts for how to properly disable positional tracking using the new integration?
    This topic has been closed for replies.

    14 replies

    Inspiring
    September 1, 2015

    It's normal practice to fix by manual replacement of CenterEyeAnchor position, but in Unity this approach (via Update, LateUpdate, and PreRender) produces micro camera jumps - so this practice is not working (or i am just making something wrong?)


    Same here, LateUpdate is not longer working... I used to link to the center with this script:
    JavaScript:
    function LateUpdate () {
    var rotation = Quaternion.LookRotation(Vector3.up , Vector3.forward);
    transform.rotation = rotation;
    }

    or C#
    using UnityEngine;
    using System.Collections;

    public class Lockrotation : MonoBehaviour {
    void LateUpdate() {

    Quaternion rotation = Quaternion.LookRotation(Vector3.up , Vector3.forward);
    transform.rotation = rotation;
    }
    }


    Any help would be really apretiated
    Up and Coming
    September 1, 2015
    "vrtube" wrote:
    I did the TRS matrix approach you mentioned, but it had the same result as the OVRPose inverse, where the camera appears to oscillate between two positions each frame.
    I ended up getting it to work with the frustratingly simple line:

    TrackingSpace.position = CenterEyeAnchor.localPosition * -1f


    (My OVRCamera happens to be at the origin, otherwise one would have to account for that offset)

    Thanks for the help!


    Hi. Thank you. I tried it later and it worked with camera jumps. Could you please possible describe when you are calling this code?
    Up and Coming
    July 30, 2018
    The following worked for me, Unity 2018.1.8 and OVR SDK 1.24.
    Line 173 OVRCameraRig near the end of UpdateAnchors() method, just before calling RaiseUpdatedAnchorsEvent().

    trackingSpace.localPosition = -1 * centerEyeAnchor.localPosition;

    That solves the camera, if you also want your avatar to stay in the same position, you need to add this at the end of OvrAvatarLocalDriver.CalculateCurrentPose():
    CurrentPose.handLeftPosition -= headPos;
    CurrentPose.handRightPosition -= headPos;
    CurrentPose.headPosition = Vector3.zero;

    Basically it will move the head back to the center of the tracking space and move the hands so they maintain their relative position to the head.

    Tada! Head AND avatar remains absolutely fixed in position and at the correct position, with your hands still at their appropriate positions relative to the head and can still look around freely. Perfect!

    I've searched this topic for some time now and am surprised this post is the only I've found that has a working solution. It still feels very hackish and I'm sure there is a more elegant solution out there, so let me know if you find it!
    Inspiring
    September 20, 2018

    I've searched this topic for some time now and am surprised this post is the only I've found that has a working solution. It still feels very hackish and I'm sure there is a more elegant solution out there, so let me know if you find it!

    You're not alone.  I needed this for a VRcade game where the player is riding a surfboard but we don't want them moving around.  Thanks for sharing a solution!