public static void UpdateSessionConfig( IntPtr sessionHandle, IntPtr configHandle, ARCoreExtensionsConfig config) { if (config.DepthModeOverride != DepthModeOverride.DoNotOverride) { ApiDepthMode apiDepthMode = config.DepthModeOverride.ToApiDepthMode(); ExternApi.ArConfig_setDepthMode(sessionHandle, configHandle, apiDepthMode); } #if UNITY_ANDROID ApiCloudAnchorMode cloudAnchorMode = (ApiCloudAnchorMode)config.CloudAnchorMode; ExternApi.ArConfig_setCloudAnchorMode( sessionHandle, configHandle, cloudAnchorMode); ApiSegmentationMode segmentationMode = config.SegmentationMode.ToApiSegmentationMode(); ExternApi.ArConfig_setSegmentationMode_private( sessionHandle, configHandle, segmentationMode); #endif if (config.UseHorizontalAndVerticalLowFeatureGrowth) { ExternApi.ArConfig_setPlaneFindingMode( sessionHandle, configHandle, ApiPlaneFindingModes.HorizontalAndVerticalLowFeatureGrowth); } }
public bool IsDepthModeSupported(ApiDepthMode depthMode) { int isSupported = 0; ExternApi.ArSession_isDepthModeSupported( _nativeSession.SessionHandle, depthMode, ref isSupported); return(isSupported != 0); }
public static void UpdateApiConfigWithARCoreSessionConfig(IntPtr sessionHandle, IntPtr configHandle, ARCoreSessionConfig sessionConfig) { ApiLightEstimationMode lightingMode = sessionConfig.LightEstimationMode.ToApiLightEstimationMode(); ExternApi.ArConfig_setLightEstimationMode(sessionHandle, configHandle, lightingMode); ApiPlaneFindingMode planeFindingMode = sessionConfig.PlaneFindingMode.ToApiPlaneFindingMode(); ExternApi.ArConfig_setPlaneFindingMode(sessionHandle, configHandle, planeFindingMode); ApiUpdateMode updateMode = sessionConfig.MatchCameraFramerate ? ApiUpdateMode.Blocking : ApiUpdateMode.LatestCameraImage; ExternApi.ArConfig_setUpdateMode(sessionHandle, configHandle, updateMode); ApiCloudAnchorMode cloudAnchorMode = sessionConfig.CloudAnchorMode.ToApiCloudAnchorMode(); ExternApi.ArConfig_setCloudAnchorMode(sessionHandle, configHandle, cloudAnchorMode); IntPtr augmentedImageDatabaseHandle = IntPtr.Zero; if (sessionConfig.AugmentedImageDatabase != null) { augmentedImageDatabaseHandle = sessionConfig.AugmentedImageDatabase._nativeHandle; ExternApi.ArConfig_setAugmentedImageDatabase(sessionHandle, configHandle, augmentedImageDatabaseHandle); } else { ExternApi.ArConfig_setAugmentedImageDatabase(sessionHandle, configHandle, IntPtr.Zero); } ApiAugmentedFaceMode augmentedFaceMode = sessionConfig.AugmentedFaceMode.ToApiAugmentedFaceMode(); ExternApi.ArConfig_setAugmentedFaceMode(sessionHandle, configHandle, augmentedFaceMode); ApiCameraFocusMode focusMode = sessionConfig.CameraFocusMode.ToApiCameraFocusMode(); ExternApi.ArConfig_setFocusMode(sessionHandle, configHandle, focusMode); if (!InstantPreviewManager.IsProvidingPlatform) { ApiDepthMode depthMode = sessionConfig.DepthMode.ToApiDepthMode(); ExternApi.ArConfig_setDepthMode(sessionHandle, configHandle, depthMode); } if (!InstantPreviewManager.IsProvidingPlatform) { ExternApi.ArConfig_setInstantPlacementMode(sessionHandle, configHandle, sessionConfig.InstantPlacementMode); } }
public static extern void ArConfig_setDepthMode( IntPtr session, IntPtr config, ApiDepthMode mode);
public static extern void ArSession_isDepthModeSupported( IntPtr sessionHandle, ApiDepthMode depthMode, ref int isSupported);