Example #1
0
 public TrackableApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #2
0
 public CameraApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #3
0
 public SessionConfigApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #4
0
 public TrackableManager(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #5
0
 public AugmentedFaceApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #6
0
 public SessionApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #7
0
 public PointApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #8
0
        private void _OnEarlyUpdate()
        {
            // Update session activity before EarlyUpdate.
            if (m_HaveDisableToEnableTransition)
            {
                _SetSessionEnabled(false);
                _SetSessionEnabled(true);
                m_HaveDisableToEnableTransition = false;

                // Avoid firing session enable event twice.
                if (m_DesiredSessionState.HasValue && m_DesiredSessionState.Value)
                {
                    m_DesiredSessionState = null;
                }
            }

            if (m_DesiredSessionState.HasValue)
            {
                _SetSessionEnabled(m_DesiredSessionState.Value);
                m_DesiredSessionState = null;
            }

            // Perform updates before calling ArPresto_update.
            if (SessionComponent != null)
            {
                IntPtr previousSession = IntPtr.Zero;
                ExternApi.ArPresto_getSession(ref previousSession);

                if (UpdateSessionFeatures != null)
                {
                    UpdateSessionFeatures();
                }

                _SetCameraDirection(SessionComponent.DeviceCameraDirection);

                IntPtr currentSession = IntPtr.Zero;
                ExternApi.ArPresto_getSession(ref currentSession);

                // Fire the session enabled event when the underlying session has been changed
                // due to session feature update(camera direction etc).
                if (previousSession != currentSession)
                {
                    _FireOnSessionSetEnabled(false);
                    _FireOnSessionSetEnabled(true);
                }

                _SetConfiguration(SessionComponent.SessionConfig);
            }

            _UpdateDisplayGeometry();

            // Update ArPresto and potentially ArCore.
            ExternApi.ArPresto_update();

            SessionStatus previousSessionStatus = SessionStatus;

            // Get state information from ARPresto.
            ApiPrestoStatus prestoStatus = ApiPrestoStatus.Uninitialized;

            ExternApi.ArPresto_getStatus(ref prestoStatus);
            SessionStatus = prestoStatus.ToSessionStatus();

            LostTrackingReason = LostTrackingReason.None;
            if (NativeSession != null && SessionStatus == SessionStatus.LostTracking)
            {
                var cameraHandle = NativeSession.FrameApi.AcquireCamera();
                LostTrackingReason = NativeSession.CameraApi.GetLostTrackingReason(cameraHandle);
                NativeSession.CameraApi.Release(cameraHandle);
            }

            // If the current status is an error, check if the SessionStatus error state changed.
            if (SessionStatus.IsError() &&
                previousSessionStatus.IsError() != SessionStatus.IsError())
            {
                // Disable internal session bits so we properly pause the session due to error.
                _FireOnSessionSetEnabled(false);
                m_DisabledSessionOnErrorState = true;
            }
            else if (SessionStatus.IsValid() && m_DisabledSessionOnErrorState)
            {
                if (SessionComponent.enabled)
                {
                    _FireOnSessionSetEnabled(true);
                }

                m_DisabledSessionOnErrorState = false;
            }

            // Get the current session from presto and note if it has changed.
            IntPtr sessionHandle = IntPtr.Zero;

            ExternApi.ArPresto_getSession(ref sessionHandle);
            IsSessionChangedThisFrame = m_CachedSessionHandle != sessionHandle;
            m_CachedSessionHandle     = sessionHandle;

            ExternApi.ArPresto_getFrame(ref m_CachedFrameHandle);

            // Update the native session with the newest frame.
            if (NativeSession != null)
            {
                NativeSession.OnUpdate(m_CachedFrameHandle);
            }

            _UpdateTextureIfNeeded();

            if (EarlyUpdate != null)
            {
                EarlyUpdate();
            }
        }
Example #9
0
 public PoseApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #10
0
 public AugmentedImageDatabaseApi(NativeSession nativeSession)
 {
 }
Example #11
0
 public CameraConfigFilterApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #12
0
 public FrameApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #13
0
 public CameraConfigListApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #14
0
 public LightEstimateApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }
Example #15
0
 public AnchorApi(NativeSession nativeSession)
 {
     m_NativeSession = nativeSession;
 }