private void CheckHMDPoseState()
        {
            if (!NRSessionManager.Instance.IsInitialized || !isInited)
            {
                return;
            }
            var currentReason = NRFrame.LostTrackingReason;

            if (m_LastReason == LostTrackingReason.NONE && currentReason != LostTrackingReason.NONE && isReady)
            {
                if (OnHMDLostTracking != null)
                {
                    OnHMDLostTracking.Invoke();
                }
            }
            if (m_LastReason != LostTrackingReason.NONE && currentReason == LostTrackingReason.NONE && !isReady)
            {
                if (OnHMDPoseReady != null)
                {
                    OnHMDPoseReady.Invoke();
                }
                isReady = true;
            }

            m_LastReason = currentReason;
        }
Beispiel #2
0
        private void CheckHMDPoseState()
        {
            if (NRFrame.SessionStatus != SessionState.Running)
            {
                return;
            }
            var currentReason = NRFrame.LostTrackingReason;

            // When LostTrackingReason changed.
            if (currentReason != m_LastReason)
            {
                if (currentReason != LostTrackingReason.NONE)
                {
                    OnHMDLostTracking?.Invoke();
                }
                else if (currentReason == LostTrackingReason.NONE)
                {
                    OnHMDPoseReady?.Invoke();
                }
                m_LastReason = currentReason;
            }
        }