Esempio n. 1
0
        private void _SetConfiguration(ARCoreSessionConfig config)
        {
            // There is no configuration to set.
            if (config == null)
            {
                return;
            }

            // The configuration has not been updated.
            if (m_CachedConfig != null && config.Equals(m_CachedConfig) &&
                (config.AugmentedImageDatabase == null ||
                 !config.AugmentedImageDatabase.m_IsDirty) &&
                !ExperimentManager.Instance.IsConfigurationDirty)
            {
                return;
            }

            if (InstantPreviewManager.IsProvidingPlatform)
            {
                if (config.PlaneFindingMode == DetectedPlaneFindingMode.Disabled)
                {
                    InstantPreviewManager.LogLimitedSupportMessage("disable 'Plane Finding'");
                    config.PlaneFindingMode = DetectedPlaneFindingMode.Horizontal;
                }

                if (!config.EnableLightEstimation)
                {
                    InstantPreviewManager.LogLimitedSupportMessage("disable 'Light Estimation'");
                    config.EnableLightEstimation = true;
                }

                if (config.CameraFocusMode == CameraFocusMode.Auto)
                {
                    InstantPreviewManager.LogLimitedSupportMessage("enable camera Auto Focus mode");
                    config.CameraFocusMode = CameraFocusMode.Fixed;
                }

                if (config.AugmentedImageDatabase != null)
                {
                    InstantPreviewManager.LogLimitedSupportMessage("enable 'Augmented Images'");
                    config.AugmentedImageDatabase = null;
                }

                if (config.AugmentedFaceMode == AugmentedFaceMode.Mesh)
                {
                    InstantPreviewManager.LogLimitedSupportMessage("enable 'Augmented Faces'");
                    config.AugmentedFaceMode = AugmentedFaceMode.Disabled;
                }
            }

            var prestoConfig = new ApiPrestoConfig(config);

            ExternApi.ArPresto_setConfiguration(ref prestoConfig);
            m_CachedConfig = ScriptableObject.CreateInstance <ARCoreSessionConfig>();
            m_CachedConfig.CopyFrom(config);
        }
Esempio n. 2
0
 private void _SetConfiguration(ARCoreSessionConfig config)
 {
     if (config == null)
     {
         return;
     }
     if (m_CachedConfig == null || !config.Equals(m_CachedConfig) ||
         (config.AugmentedImageDatabase != null && config.AugmentedImageDatabase.m_IsDirty) ||
         ExperimentManager.Instance.IsConfigurationDirty)
     {
         var prestoConfig = new ApiPrestoConfig(config);
         ExternApi.ArPresto_setConfiguration(ref prestoConfig);
         m_CachedConfig = ScriptableObject.CreateInstance <ARCoreSessionConfig>();
         m_CachedConfig.CopyFrom(config);
     }
 }
        public void SetConfiguration(ARCoreSessionConfig config)
        {
            if (config == null)
            {
                return;
            }

            if (m_CachedConfig == null || !config.Equals(m_CachedConfig) ||
                ExperimentManager.Instance.IsConfigurationDirty)
            {
                GCHandle handle;
                var      prestoConfig = new ApiPrestoConfig(config, out handle);
                ExternApi.ArPresto_setConfiguration(ref prestoConfig);
                m_CachedConfig = ScriptableObject.CreateInstance <ARCoreSessionConfig>();
                m_CachedConfig.CopyFrom(config);
                handle.Free();
            }
        }
        private void _SetConfiguration(ARCoreSessionConfig config)
        {
            // There is no configuration to set.
            if (config == null)
            {
                return;
            }

            // The configuration has not been updated.
            if (m_CachedConfig != null && config.Equals(m_CachedConfig) &&
                (config.AugmentedImageDatabase == null ||
                 !config.AugmentedImageDatabase.IsDirty) &&
                !ExperimentManager.Instance.IsConfigurationDirty)
            {
                return;
            }

            var prestoConfig = new ApiPrestoConfig(config);

            ExternApi.ArPresto_setConfiguration(ref prestoConfig);
            m_CachedConfig = ScriptableObject.CreateInstance <ARCoreSessionConfig>();
            m_CachedConfig.CopyFrom(config);
        }
Esempio n. 5
0
 public static extern void ArPresto_setConfiguration(ref ApiPrestoConfig config);