/// <summary>
 /// ValueType copy from another SessionConfig object into this one.
 /// </summary>
 /// <param name="other">The SessionConfig to copy from.</param>
 public void CopyFrom(ARCoreSessionConfig other)
 {
     MatchCameraFramerate   = other.MatchCameraFramerate;
     PlaneFindingMode       = other.PlaneFindingMode;
     LightEstimationMode    = other.LightEstimationMode;
     CloudAnchorMode        = other.CloudAnchorMode;
     AugmentedImageDatabase = other.AugmentedImageDatabase;
     CameraFocusMode        = other.CameraFocusMode;
     AugmentedFaceMode      = other.AugmentedFaceMode;
 }
Exemple #2
0
        /// <summary>
        /// Part of the [ISerializationCallbackReceiver](https://docs.unity3d.com/ScriptReference/ISerializationCallbackReceiver.html)
        /// interface. Invoked after deserialization.
        /// </summary>
        public void OnAfterDeserialize()
        {
            if (m_FocusMode != (CameraFocusMode)(-1))
            {
                m_AutoFocus = m_FocusMode == CameraFocusMode.Auto;
                m_FocusMode = (CameraFocusMode)(-1);
            }

            if (m_LightEstimationMode != (LightEstimationMode)(-1))
            {
                m_LightEstimation     = m_LightEstimationMode.ToLightEstimation();
                m_LightEstimationMode = (LightEstimationMode)(-1);
            }
        }
        /// <summary>
        /// Convert the deprecated <c>LightEstimationMode</c> to <see cref="LightEstimation"/>.
        /// </summary>
        /// <param name="mode">The <c>LightEstimationMode</c> to convert.</param>
        /// <returns>The <see cref="LightEstimation"/> representation of the <c>LightEstimationMode</c>.</returns>
        public static LightEstimation ToLightEstimation(this LightEstimationMode mode)
        {
            switch (mode)
            {
            case LightEstimationMode.AmbientIntensity:
                return(LightEstimation.AmbientIntensity
                       | LightEstimation.AmbientColor);

            case LightEstimationMode.EnvironmentalHDR:
                return(LightEstimation.AmbientSphericalHarmonics
                       | LightEstimation.MainLightIntensity
                       | LightEstimation.MainLightDirection);

            default:
                return(LightEstimation.None);
            }
        }
        public static ApiLightEstimationMode ToApiLightEstimationMode(this LightEstimationMode mode)
        {
            switch (mode)
            {
            case LightEstimationMode.Disabled:
                return(ApiLightEstimationMode.Disabled);

            case LightEstimationMode.AmbientIntensity:
                return(ApiLightEstimationMode.AmbientIntensity);

            case LightEstimationMode.EnvironmentalHDRWithoutReflections:
            case LightEstimationMode.EnvironmentalHDRWithReflections:
                return(ApiLightEstimationMode.EnvironmentalHDR);

            default:
                Debug.LogErrorFormat("Unexpected LightEstimationMode {0}", mode);
                return(ApiLightEstimationMode.Disabled);
            }
        }
Exemple #5
0
 public static bool UnityARKit_Camera_TrySetLightEstimationMode(LightEstimationMode lightEstimationMode)
 {
     return(false);
 }
Exemple #6
0
 public static extern bool UnityARKit_Camera_TrySetLightEstimationMode(LightEstimationMode lightEstimationMode);
Exemple #7
0
 /// <summary>
 /// Set the light estimation mode.
 /// </summary>
 /// <param name="lightEstimationMode">The light estimation mode to set.</param>
 /// <returns>
 /// <c>true</c> if the method successfully set the light estimation mode. Otherwise, <c>false</c>.
 /// </returns>
 public override bool TrySetLightEstimationMode(LightEstimationMode lightEstimationMode)
 {
     return(NativeApi.UnityARKit_Camera_TrySetLightEstimationMode(lightEstimationMode));
 }
Exemple #8
0
 /// <summary>
 /// Method to be implemented by the provider to set the light estimation mode.
 /// </summary>
 /// <param name="lightEstimationMode">The light estimation mode to set.</param>
 /// <returns>
 /// <c>true</c> if the method successfully set the light estimation mode. Otherwise, <c>false</c>.
 /// </returns>
 public virtual bool TrySetLightEstimationMode(LightEstimationMode lightEstimationMode) => false;
 public override bool TrySetLightEstimationMode(LightEstimationMode lightEstimationMode)
 {
     return(false);
 }
Exemple #10
0
 /// <summary>
 /// Method to be implemented by the provider to set the light estimation mode.
 /// </summary>
 /// <param name="lightEstimationMode">The light estimation mode to set.</param>
 /// <returns>
 /// <c>true</c> if the method successfully set the light estimation mode. Otherwise, <c>false</c>.
 /// </returns>
 public virtual bool TrySetLightEstimationMode(
     LightEstimationMode lightEstimationMode)
 {
     return(false);
 }