GetTrackerPose() public static method

public static GetTrackerPose ( Tracker trackerId ) : Posef
trackerId Tracker
return Posef
Example #1
0
    /// <summary>
    /// Gets the sensor's pose, relative to the head's pose at the time of the last pose recentering.
    /// </summary>
    public OVRPose GetPose(double predictionTime)
    {
#if !UNITY_ANDROID || UNITY_EDITOR
        if (OVRManager.instance.isVRPresent)
        {
            return(OVRPlugin.GetTrackerPose(OVRPlugin.Tracker.Zero).ToOVRPose());
        }
#endif
        return(new OVRPose
        {
            position = Vector3.zero,
            orientation = Quaternion.identity
        });
    }
    /// <summary>
    /// Gets the sensor's pose, relative to the head's pose at the time of the last pose recentering.
    /// </summary>
    public OVRPose GetPose(int tracker = 0)
    {
        if (!OVRManager.isHmdPresent)
        {
            return(OVRPose.identity);
        }

        var p = OVRPlugin.GetTrackerPose((OVRPlugin.Tracker)tracker).ToOVRPose();

        return(new OVRPose()
        {
            position = p.position,
            orientation = p.orientation * Quaternion.Euler(0, 180, 0)
        });
    }
Example #3
0
    /// <summary>
    /// Gets the tracker's pose, relative to the head's pose at the time of the last pose recentering.
    /// </summary>
    public OVRPose GetPose(double predictionTime)
    {
        if (!UnityEngine.XR.XRDevice.isPresent)
        {
            return(OVRPose.identity);
        }

        var p = OVRPlugin.GetTrackerPose(OVRPlugin.Tracker.Default).ToOVRPose();

        return(new OVRPose()
        {
            position = p.position,
            orientation = p.orientation * Quaternion.Euler(0, 180, 0)
        });
    }