public PointCloudManager(NativeSession session) { m_NativeSession = session; }
public CameraConfigApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public HitTestApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
private void OnEarlyUpdate() { SetCameraTextureName(); // Update session activity before EarlyUpdate. if (_haveDisableToEnableTransition) { SetSessionEnabled(false); SetSessionEnabled(true); _haveDisableToEnableTransition = false; // Avoid firing session enable event twice. if (_desiredSessionState.HasValue && _desiredSessionState.Value) { _desiredSessionState = null; } } if (_desiredSessionState.HasValue) { SetSessionEnabled(_desiredSessionState.Value); _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); } // Validate and convert the SessionConfig to a Instant Preview supported config by // logging and disabling limited supported features. if (InstantPreviewManager.IsProvidingPlatform && SessionComponent.SessionConfig != null && !InstantPreviewManager.ValidateSessionConfig(SessionComponent.SessionConfig)) { // A new SessionConfig object will be created based on the original // SessionConfig with all limited support features disabled. SessionComponent.SessionConfig = InstantPreviewManager.GenerateInstantPreviewSupportedConfig( SessionComponent.SessionConfig); } UpdateConfiguration(SessionComponent.SessionConfig); } UpdateDisplayGeometry(); // Update ArPresto and potentially ArCore. ExternApi.ArPresto_update(); if (SystemInfo.graphicsMultiThreaded && !InstantPreviewManager.IsProvidingPlatform) { // Synchronize render thread with update call. ExternApi.ARCoreRenderingUtils_CreatePostUpdateFence(); } 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); _disabledSessionOnErrorState = true; } else if (SessionStatus.IsValid() && _disabledSessionOnErrorState) { if (SessionComponent.enabled) { FireOnSessionSetEnabled(true); } _disabledSessionOnErrorState = false; } // Get the current session from presto and note if it has changed. IntPtr sessionHandle = IntPtr.Zero; ExternApi.ArPresto_getSession(ref sessionHandle); IsSessionChangedThisFrame = _cachedSessionHandle != sessionHandle; _cachedSessionHandle = sessionHandle; ExternApi.ArPresto_getFrame(ref _cachedFrameHandle); // Update the native session with the newest frame. if (NativeSession != null) { NativeSession.OnUpdate(_cachedFrameHandle); } UpdateTextureIfNeeded(); if (EarlyUpdate != null) { EarlyUpdate(); } }
public TrackableManager(NativeSession nativeSession) { m_NativeSession = nativeSession; LifecycleManager.Instance.OnResetInstance += _ClearCachedTrackables; }
public CameraConfigFilterApi(NativeSession nativeSession) { _nativeSession = nativeSession; }
public void DestroySession() { m_SessionComponent = null; m_NativeSession = null; ExternApi.ArPresto_reset(); }
private ApiPrestoCallbackResult OnBeforeResumeSession(IntPtr sessionHandle) { ApiPrestoCallbackResult result = ApiPrestoCallbackResult.InvalidCameraConfig; if (SessionComponent == null || sessionHandle == IntPtr.Zero) { return(result); } NativeSession tempNativeSession = GetNativeSession(sessionHandle); var listHandle = tempNativeSession.CameraConfigListApi.Create(); tempNativeSession.SessionApi.GetSupportedCameraConfigurationsWithFilter( SessionComponent.CameraConfigFilter, listHandle, _tempCameraConfigHandles, _tempCameraConfigs, SessionComponent.DeviceCameraDirection); if (_tempCameraConfigHandles.Count == 0) { Debug.LogWarning( "Unable to choose a custom camera configuration because none are available."); } else { var configIndex = 0; if (SessionComponent.GetChooseCameraConfigurationCallback() != null) { configIndex = SessionComponent.GetChooseCameraConfigurationCallback()( _tempCameraConfigs); } if (configIndex >= 0 && configIndex < _tempCameraConfigHandles.Count) { var status = tempNativeSession.SessionApi.SetCameraConfig( _tempCameraConfigHandles[configIndex]); if (status != ApiArStatus.Success) { Debug.LogErrorFormat( "Failed to set the ARCore camera configuration: {0}", status); } else { result = ApiPrestoCallbackResult.Success; // sync the session configuration with the new camera direction. ExternApi.ArPresto_setConfigurationDirty(); } } for (int i = 0; i < _tempCameraConfigHandles.Count; i++) { tempNativeSession.CameraConfigApi.Destroy(_tempCameraConfigHandles[i]); } } // clean up tempNativeSession.CameraConfigListApi.Destroy(listHandle); _tempCameraConfigHandles.Clear(); _tempCameraConfigs.Clear(); return(result); }
public PointCloudApi(NativeSession nativeSession) { _nativeSession = nativeSession; }
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. _UpdateDisplayGeometry(); if (SessionComponent != null) { _SetCameraDirection(SessionComponent.DeviceCameraDirection); _SetConfiguration(SessionComponent.SessionConfig); } // Update ArPresto and potentially ArCore. ExternApi.ArPresto_update(); // 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); } // 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(); } }
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(); } }
public TrackDataListApi(NativeSession nativeSession) { _nativeSession = nativeSession; }
public AnchorApi(NativeSession nativeSession) { _nativeSession = nativeSession; }
public AugmentedImageApi(NativeSession nativeSession) { _nativeSession = nativeSession; }
public SessionConfigApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public PoseApi(NativeSession nativeSession) { _nativeSession = nativeSession; }
public PointApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public CameraMetadataApi(NativeSession nativeSession) { _nativeSession = nativeSession; }
public TrackableManager(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public TrackableApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public ImageApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public CameraApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public SessionApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public RecordingConfigApi(NativeSession nativeSession) { _nativeSession = nativeSession; }
public TrackableListApi(NativeSession nativeSession) { _nativeSession = nativeSession; }
public AugmentedFaceApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public FrameApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public LightEstimateApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public AugmentedImageDatabaseApi(NativeSession nativeSession) { m_NativeSession = nativeSession; }
public TrackApi(NativeSession nativeSession) { _nativeSession = nativeSession; }