/// 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();
        }
    }
Esempio n. 2
0
 public void UpdateDeviceState()
 {
     if (device != null)
     {
         device.UpdateState();
     }
 }
Esempio n. 3
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 (!updated)
     {
         device.UpdateState();
         updated = true;
     }
 }
Esempio n. 4
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();
         DispatchEvents();
     }
 }
Esempio n. 5
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 (!updated)
     {
         updated = true;
         device.UpdateState();
         DispatchEvents();
     }
 }
Esempio n. 6
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 && distortionCorrectionEnabled)
            {
                DistortionCorrectionEnabled = true;
            }

            DispatchEvents();
        }
    }
Esempio n. 7
0
 public void UpdateState()
 {
     if (!updated)
     {
         device.UpdateState();
         if (TapIsTrigger)
         {
             if (Input.GetMouseButtonUp(0))
             {
                 device.triggered = true;
             }
             if (Input.GetKeyUp(KeyCode.Escape))
             {
                 device.tilted = true;
             }
         }
         updated = true;
     }
 }
Esempio n. 8
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.None)
                {
                    DistortionCorrection = DistortionCorrectionMethod.None;
                }
                if (stereoScreen != null &&
                    device.ShouldRecreateStereoScreen(stereoScreen.width, stereoScreen.height))
                {
                    StereoScreen = null;
                }
            }

            DispatchEvents();
        }
    }