protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            MyObjectBuilder_VisualSettingsDefinition objBuilder = (MyObjectBuilder_VisualSettingsDefinition)builder;
            FogProperties = objBuilder.FogProperties;
            SunProperties = objBuilder.SunProperties;
            PostProcessSettings = objBuilder.PostProcessSettings;
            ShadowSettings.CopyFrom(objBuilder.ShadowSettings);
        }
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            MyObjectBuilder_VisualSettingsDefinition objBuilder = (MyObjectBuilder_VisualSettingsDefinition)builder;

            FogProperties       = objBuilder.FogProperties;
            SunProperties       = objBuilder.SunProperties;
            PostProcessSettings = objBuilder.PostProcessSettings;
            ShadowSettings.CopyFrom(objBuilder.ShadowSettings);
        }
Exemplo n.º 3
0
 static MySunProperties()
 {
     Default = new MySunProperties()
     {
         SunIntensity               = Defaults.SunIntensity,
         BackLightIntensity1        = Defaults.BackLightIntensity1,
         BackLightIntensity2        = Defaults.BackLightIntensity2,
         EnvironmentLight           = MyEnvironmentLightData.Default,
         SunDirectionNormalized     = Defaults.SunDirectionNormalized,
         BaseSunDirectionNormalized = Defaults.BaseSunDirectionNormalized,
         SunMaterial   = Defaults.SunMaterial,
         DistanceToSun = Defaults.DistanceToSun,
     };
 }
Exemplo n.º 4
0
 static MySunProperties()
 {
     Default = new MySunProperties()
     {
         SunIntensity = Defaults.SunIntensity,
         BackLightIntensity1 = Defaults.BackLightIntensity1,
         BackLightIntensity2 = Defaults.BackLightIntensity2,
         EnvironmentLight = MyEnvironmentLightData.Default,
         SunDirectionNormalized = Defaults.SunDirectionNormalized,
         BaseSunDirectionNormalized = Defaults.BaseSunDirectionNormalized,
         SunMaterial = Defaults.SunMaterial,
         DistanceToSun = Defaults.DistanceToSun,
     };
 }
Exemplo n.º 5
0
        /// <param name="interpolator">0 - use this object, 1 - use other object</param>
        public MySunProperties InterpolateWith(MySunProperties other, float interpolator)
        {
            var result = new MySunProperties();

            result.SunIntensity = MathHelper.Lerp(this.SunIntensity, other.SunIntensity, interpolator);
            result.BackLightIntensity1 = MathHelper.Lerp(this.BackLightIntensity1, other.BackLightIntensity1, interpolator);
            result.BackLightIntensity2 = MathHelper.Lerp(this.BackLightIntensity2, other.BackLightIntensity2, interpolator);
            result.EnvironmentLight = EnvironmentLight.InterpolateWith(ref other.EnvironmentLight, interpolator);
            if (result.SunDirectionNormalized.Dot(other.SunDirectionNormalized) > 0.0001f)
                result.SunDirectionNormalized = Vector3.Lerp(SunDirectionNormalized, other.SunDirectionNormalized, interpolator);
            else
                result.SunDirectionNormalized = SunDirectionNormalized;

            return result;
        }
Exemplo n.º 6
0
        /// <param name="interpolator">0 - use this object, 1 - use other object</param>
        public MySunProperties InterpolateWith(MySunProperties other, float interpolator)
        {
            var result = new MySunProperties();

            result.SunIntensity        = MathHelper.Lerp(this.SunIntensity, other.SunIntensity, interpolator);
            result.BackLightIntensity1 = MathHelper.Lerp(this.BackLightIntensity1, other.BackLightIntensity1, interpolator);
            result.BackLightIntensity2 = MathHelper.Lerp(this.BackLightIntensity2, other.BackLightIntensity2, interpolator);
            result.EnvironmentLight    = EnvironmentLight.InterpolateWith(ref other.EnvironmentLight, interpolator);
            if (result.SunDirectionNormalized.Dot(other.SunDirectionNormalized) > 0.0001f)
            {
                result.SunDirectionNormalized = Vector3.Lerp(SunDirectionNormalized, other.SunDirectionNormalized, interpolator);
            }
            else
            {
                result.SunDirectionNormalized = SunDirectionNormalized;
            }

            return(result);
        }