Пример #1
0
    /// Reads the latest tracking data from the phone.  This must be
    /// called before accessing any of the poses and matrices above.
    ///
    /// Multiple invocations per frame are OK:  Subsequent calls merely yield the
    /// cached results of the first call.  To minimize latency, it should be first
    /// called later in the frame (for example, in `LateUpdate`) if possible.
    public void UpdateState()
    {
        if (updatedToFrame != Time.frameCount)
        {
            updatedToFrame = Time.frameCount;
            device.UpdateState();

            if (device.profileChanged)
            {
                if (distortionCorrection != DistortionCorrectionMethod.Native &&
                    device.RequiresNativeDistortionCorrection())
                {
                    DistortionCorrection = DistortionCorrectionMethod.Native;
                }
                if (stereoScreen != null &&
                    device.ShouldRecreateStereoScreen(stereoScreen.width, stereoScreen.height))
                {
                    Svr.SvrLog.Log("StereoScreen set to Null");
                    StereoScreen = null;
                }
            }

            DispatchEvents();
        }
    }
Пример #2
0
    /// Reads the latest tracking data from the phone.  This must be
    /// called before accessing any of the poses and matrices above.
    ///
    /// Multiple invocations per frame are OK:  Subsequent calls merely yield the
    /// cached results of the first call.  To minimize latency, it should be first
    /// called later in the frame (for example, in `LateUpdate`) if possible.
    public void UpdateState()
    {
        if (updatedToFrame != Time.frameCount)
        {
            updatedToFrame = Time.frameCount;
            device.UpdateState();

            if (device.profileChanged)
            {
                if (distortionCorrection != DistortionCorrectionMethod.Unity &&                   //Fix
                    device.RequiresNativeDistortionCorrection())
                {
                    DistortionCorrection = DistortionCorrectionMethod.Unity;                         //Fix
                }
                if (stereoScreen != null &&
                    device.ShouldRecreateStereoScreen(stereoScreen.width, stereoScreen.height))
                {
                    StereoScreen = null;
                }
            }

            DispatchEvents();
        }
    }