Esempio n. 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;
         DispatchEvents();
         if (NvrViewer.Instance.NeedUpdateNearFar && device != null && device.nibiruVRServiceId != 0)
         {
             float far   = NvrViewer.Instance.GetCameraFar();
             float mNear = 0.0305f;
             if (NvrGlobal.fovNear > -1)
             {
                 mNear = NvrGlobal.fovNear;
             }
             device.SetCameraNearFar(mNear, far);
             NvrViewer.Instance.NeedUpdateNearFar = false;
         }
     }
 }