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

            MyObjectBuilder_EnvironmentDefinition objBuilder = (MyObjectBuilder_EnvironmentDefinition)builder;

            BackgroundTexture                 = objBuilder.EnvironmentTexture;
            BackgroundTextureNight            = objBuilder.EnvironmentTextureNight ?? BackgroundTexture;
            BackgroundTextureNightPrefiltered = objBuilder.EnvironmentTextureNightPrefiltered ?? BackgroundTextureNight;
            BackgroundOrientation             = new MyOrientation(
                MathHelper.ToRadians(objBuilder.EnvironmentOrientation.Yaw),
                MathHelper.ToRadians(objBuilder.EnvironmentOrientation.Pitch),
                MathHelper.ToRadians(objBuilder.EnvironmentOrientation.Roll));

            SmallShipMaxSpeed         = objBuilder.SmallShipMaxSpeed;
            LargeShipMaxSpeed         = objBuilder.LargeShipMaxSpeed;
            EnvironmentalParticles    = objBuilder.EnvironmentalParticles;
            SmallShipMaxAngularSpeed  = objBuilder.SmallShipMaxAngularSpeed;
            LargeShipMaxAngularSpeed  = objBuilder.LargeShipMaxAngularSpeed;
            ContourHighlightColor     = new Color(objBuilder.ContourHighlightColor);
            ContourHighlightThickness = objBuilder.ContourHighlightThickness;
            HighlightPulseInSeconds   = objBuilder.HighlightPulseInSeconds;
            FogProperties.Deserialize(objBuilder);
            SunProperties.Deserialize(objBuilder);
        }
示例#2
0
        public override MyObjectBuilder_DefinitionBase GetObjectBuilder()
        {
            MyObjectBuilder_EnvironmentDefinition definition1 = new MyObjectBuilder_EnvironmentDefinition();

            definition1.Id                  = (SerializableDefinitionId)base.Id;
            definition1.FogProperties       = this.FogProperties;
            definition1.SunProperties       = this.SunProperties;
            definition1.PostProcessSettings = this.PostProcessSettings;
            definition1.SSAOSettings        = this.SSAOSettings;
            definition1.HBAOSettings        = this.HBAOSettings;
            definition1.ShadowSettings.CopyFrom(this.ShadowSettings);
            definition1.LowLoddingSettings.CopyFrom(this.LowLoddingSettings);
            definition1.MediumLoddingSettings.CopyFrom(this.MediumLoddingSettings);
            definition1.HighLoddingSettings.CopyFrom(this.HighLoddingSettings);
            definition1.ExtremeLoddingSettings.CopyFrom(this.ExtremeLoddingSettings);
            definition1.SmallShipMaxSpeed         = this.SmallShipMaxSpeed;
            definition1.LargeShipMaxSpeed         = this.LargeShipMaxSpeed;
            definition1.SmallShipMaxAngularSpeed  = this.SmallShipMaxAngularSpeed;
            definition1.LargeShipMaxAngularSpeed  = this.LargeShipMaxAngularSpeed;
            definition1.ContourHighlightColor     = this.ContourHighlightColor.ToVector4();
            definition1.ContourHighlightThickness = this.ContourHighlightThickness;
            definition1.HighlightPulseInSeconds   = this.HighlightPulseInSeconds;
            definition1.EnvironmentTexture        = this.EnvironmentTexture;
            definition1.EnvironmentOrientation    = this.EnvironmentOrientation;
            definition1.EnvironmentalParticles    = this.EnvironmentalParticles;
            return(definition1);
        }
示例#3
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            MyObjectBuilder_EnvironmentDefinition objBuilder = (MyObjectBuilder_EnvironmentDefinition)builder;

            FogProperties       = objBuilder.FogProperties;
            SunProperties       = objBuilder.SunProperties;
            PostProcessSettings = objBuilder.PostProcessSettings;
            SSAOSettings        = objBuilder.SSAOSettings;
            HBAOSettings        = objBuilder.HBAOSettings;
            ShadowSettings.CopyFrom(objBuilder.ShadowSettings);
            NewPipelineSettings.CopyFrom(objBuilder.NewPipelineSettings);
            MaterialsSettings.CopyFrom(objBuilder.MaterialsSettings);
            SmallShipMaxSpeed         = objBuilder.SmallShipMaxSpeed;
            LargeShipMaxSpeed         = objBuilder.LargeShipMaxSpeed;
            SmallShipMaxAngularSpeed  = objBuilder.SmallShipMaxAngularSpeed;
            LargeShipMaxAngularSpeed  = objBuilder.LargeShipMaxAngularSpeed;
            ContourHighlightColor     = new Color(objBuilder.ContourHighlightColor);
            ContourHighlightThickness = objBuilder.ContourHighlightThickness;
            HighlightPulseInSeconds   = objBuilder.HighlightPulseInSeconds;
            EnvironmentTexture        = objBuilder.EnvironmentTexture;
            EnvironmentOrientation    = objBuilder.EnvironmentOrientation;
            EnvironmentalParticles    = objBuilder.EnvironmentalParticles;
        }
示例#4
0
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);
            MyObjectBuilder_EnvironmentDefinition definition = (MyObjectBuilder_EnvironmentDefinition)builder;

            this.FogProperties       = definition.FogProperties;
            this.PlanetProperties    = definition.PlanetProperties;
            this.SunProperties       = definition.SunProperties;
            this.PostProcessSettings = definition.PostProcessSettings;
            this.SSAOSettings        = definition.SSAOSettings;
            this.HBAOSettings        = definition.HBAOSettings;
            this.ShadowSettings.CopyFrom(definition.ShadowSettings);
            this.LowLoddingSettings.CopyFrom(definition.LowLoddingSettings);
            this.MediumLoddingSettings.CopyFrom(definition.MediumLoddingSettings);
            this.HighLoddingSettings.CopyFrom(definition.HighLoddingSettings);
            this.ExtremeLoddingSettings.CopyFrom(definition.ExtremeLoddingSettings);
            this.SmallShipMaxSpeed         = definition.SmallShipMaxSpeed;
            this.LargeShipMaxSpeed         = definition.LargeShipMaxSpeed;
            this.SmallShipMaxAngularSpeed  = definition.SmallShipMaxAngularSpeed;
            this.LargeShipMaxAngularSpeed  = definition.LargeShipMaxAngularSpeed;
            this.ContourHighlightColor     = new Color(definition.ContourHighlightColor);
            this.ContourHighlightThickness = definition.ContourHighlightThickness;
            this.HighlightPulseInSeconds   = definition.HighlightPulseInSeconds;
            this.EnvironmentTexture        = definition.EnvironmentTexture;
            this.EnvironmentOrientation    = definition.EnvironmentOrientation;
            this.EnvironmentalParticles    = definition.EnvironmentalParticles;
        }
示例#5
0
        public void Deserialize(MyObjectBuilder_EnvironmentDefinition builder)
        {
            SunIntensity           = builder.SunIntensity;
            SunDiffuse             = new Color((Vector3)builder.SunDiffuse);
            SunSpecular            = new Color((Vector3)builder.SunSpecular);
            AdditionalSunDirection = new Vector2[Math.Min(builder.AdditionalSunDirection.Length, MyRenderMessageUpdateRenderEnvironment.MaxAdditionalSuns)];
            AdditionalSunDiffuse   = new Color[AdditionalSunDirection.Length];
            AdditionalSunIntensity = new float[AdditionalSunDirection.Length];

            for (int lightIndex = 0; lightIndex < AdditionalSunDirection.Length; ++lightIndex)
            {
                AdditionalSunDirection[lightIndex] = builder.AdditionalSunDirection[lightIndex];
                AdditionalSunIntensity[lightIndex] = builder.BackLightIntensity;
                AdditionalSunDiffuse[lightIndex]   = new Color((Vector3)builder.BackLightDiffuse);
            }

            AmbientColor                = new Color((Vector3)builder.AmbientColor);
            AmbientMultiplier           = builder.AmbientMultiplier;
            EnvironmentAmbientIntensity = builder.EnvironmentAmbientIntensity;
            SunSizeMultiplier           = builder.SunSizeMultiplier;
            BackgroundColor             = new Color((Vector3)builder.BackgroundColor);
            SunMaterial                = builder.SunMaterial;
            SunDirectionNormalized     = Vector3.Normalize(builder.SunDirection);
            BaseSunDirectionNormalized = SunDirectionNormalized;
        }
示例#6
0
        public override MyObjectBuilder_DefinitionBase GetObjectBuilder()
        {
            var result = new MyObjectBuilder_EnvironmentDefinition();

            result.Id                  = Id;
            result.FogProperties       = FogProperties;
            result.SunProperties       = SunProperties;
            result.PostProcessSettings = PostProcessSettings;
            result.SSAOSettings        = SSAOSettings;
            result.HBAOSettings        = HBAOSettings;
            result.ShadowSettings.CopyFrom(ShadowSettings);
            result.NewPipelineSettings.CopyFrom(NewPipelineSettings);
            result.MaterialsSettings.CopyFrom(MaterialsSettings);
            result.SmallShipMaxSpeed         = this.SmallShipMaxSpeed;
            result.LargeShipMaxSpeed         = this.LargeShipMaxSpeed;
            result.SmallShipMaxAngularSpeed  = this.SmallShipMaxAngularSpeed;
            result.LargeShipMaxAngularSpeed  = this.LargeShipMaxAngularSpeed;
            result.ContourHighlightColor     = this.ContourHighlightColor.ToVector4();
            result.ContourHighlightThickness = this.ContourHighlightThickness;
            result.HighlightPulseInSeconds   = this.HighlightPulseInSeconds;
            result.EnvironmentTexture        = this.EnvironmentTexture;
            result.EnvironmentOrientation    = this.EnvironmentOrientation;
            result.EnvironmentalParticles    = this.EnvironmentalParticles;

            return(result);
        }
        public override MyObjectBuilder_DefinitionBase GetObjectBuilder()
        {
            var result = new MyObjectBuilder_EnvironmentDefinition()
            {
                EnvironmentTexture                 = this.BackgroundTexture,
                EnvironmentTextureNight            = this.BackgroundTextureNight,
                EnvironmentTextureNightPrefiltered = this.BackgroundTextureNightPrefiltered,
                SmallShipMaxSpeed        = this.SmallShipMaxSpeed,
                LargeShipMaxSpeed        = this.LargeShipMaxSpeed,
                EnvironmentalParticles   = this.EnvironmentalParticles,
                SmallShipMaxAngularSpeed = this.m_smallShipMaxAngularSpeed,
                LargeShipMaxAngularSpeed = this.m_largeShipMaxAngularSpeed,
                EnvironmentOrientation   = new MyOrientation(
                    MathHelper.ToDegrees(BackgroundOrientation.Yaw),
                    MathHelper.ToDegrees(BackgroundOrientation.Pitch),
                    MathHelper.ToDegrees(BackgroundOrientation.Roll)),
                ContourHighlightColor     = this.ContourHighlightColor.ToVector4(),
                ContourHighlightThickness = this.ContourHighlightThickness,
                HighlightPulseInSeconds   = this.HighlightPulseInSeconds,
            };

            FogProperties.Serialize(result);
            SunProperties.Serialize(result);
            return(result);
        }
 public void Deserialize(MyObjectBuilder_EnvironmentDefinition builder)
 {
     EnableFog              = builder.EnableFog;
     FogNear                = builder.FogNear;
     FogFar                 = builder.FogFar;
     FogMultiplier          = builder.FogMultiplier;
     FogBacklightMultiplier = builder.FogBacklightMultiplier;
     FogColor               = new Color((Vector3)builder.FogColor);
     FogDensity             = builder.FogDensity;
 }
 public void Serialize(MyObjectBuilder_EnvironmentDefinition builder)
 {
     builder.EnableFog              = EnableFog;
     builder.FogNear                = FogNear;
     builder.FogFar                 = FogFar;
     builder.FogMultiplier          = FogMultiplier;
     builder.FogBacklightMultiplier = FogBacklightMultiplier;
     builder.FogColor               = FogColor.ToVector3();
     builder.FogDensity             = FogDensity;
 }
 public void Deserialize(MyObjectBuilder_EnvironmentDefinition builder)
 {
     EnableFog = builder.EnableFog;
     FogNear = builder.FogNear;
     FogFar = builder.FogFar;
     FogMultiplier = builder.FogMultiplier;
     FogBacklightMultiplier = builder.FogBacklightMultiplier;
     FogColor = new Color((Vector3)builder.FogColor);
     FogDensity = builder.FogDensity;
 }
 public void Serialize(MyObjectBuilder_EnvironmentDefinition builder)
 {
     builder.EnableFog = EnableFog;
     builder.FogNear = FogNear;
     builder.FogFar = FogFar;
     builder.FogMultiplier = FogMultiplier;
     builder.FogBacklightMultiplier = FogBacklightMultiplier;
     builder.FogColor = FogColor.ToVector3();
     builder.FogDensity = FogDensity;
 }
示例#12
0
 public void Serialize(MyObjectBuilder_EnvironmentDefinition builder)
 {
     builder.SunIntensity                = SunIntensity;
     builder.SunDiffuse                  = SunDiffuse.ToVector3();
     builder.SunSpecular                 = SunSpecular.ToVector3();
     builder.BackLightIntensity          = BackSunIntensity;
     builder.BackLightDiffuse            = BackSunDiffuse.ToVector3();
     builder.AmbientColor                = AmbientColor.ToVector3();
     builder.AmbientMultiplier           = AmbientMultiplier;
     builder.EnvironmentAmbientIntensity = EnvironmentAmbientIntensity;
     builder.SunSizeMultiplier           = SunSizeMultiplier;
     builder.BackgroundColor             = BackgroundColor.ToVector3();
     builder.SunMaterial                 = SunMaterial;
     builder.SunDirection                = BaseSunDirectionNormalized;
 }
示例#13
0
 public void Deserialize(MyObjectBuilder_EnvironmentDefinition builder)
 {
     SunIntensity                = builder.SunIntensity;
     SunDiffuse                  = new Color((Vector3)builder.SunDiffuse);
     SunSpecular                 = new Color((Vector3)builder.SunSpecular);
     BackSunIntensity            = builder.BackLightIntensity;
     BackSunDiffuse              = new Color((Vector3)builder.BackLightDiffuse);
     AmbientColor                = new Color((Vector3)builder.AmbientColor);
     AmbientMultiplier           = builder.AmbientMultiplier;
     EnvironmentAmbientIntensity = builder.EnvironmentAmbientIntensity;
     SunSizeMultiplier           = builder.SunSizeMultiplier;
     BackgroundColor             = new Color((Vector3)builder.BackgroundColor);
     SunMaterial                 = builder.SunMaterial;
     SunDirectionNormalized      = Vector3.Normalize(builder.SunDirection);
 }
        public override MyObjectBuilder_DefinitionBase GetObjectBuilder()
        {
            var result = new MyObjectBuilder_EnvironmentDefinition()
            {
                EnvironmentTexture       = this.BackgroundTexture,
                SmallShipMaxSpeed        = this.SmallShipMaxSpeed,
                LargeShipMaxSpeed        = this.LargeShipMaxSpeed,
                SmallShipMaxAngularSpeed = this.m_smallShipMaxAngularSpeed,
                LargeShipMaxAngularSpeed = this.m_largeShipMaxAngularSpeed,
                EnvironmentOrientation   = new MyOrientation(
                    MathHelper.ToDegrees(BackgroundOrientation.Yaw),
                    MathHelper.ToDegrees(BackgroundOrientation.Pitch),
                    MathHelper.ToDegrees(BackgroundOrientation.Roll)),
            };

            FogProperties.Serialize(result);
            SunProperties.Serialize(result);
            return(result);
        }
        protected override void Init(MyObjectBuilder_DefinitionBase builder)
        {
            base.Init(builder);

            MyObjectBuilder_EnvironmentDefinition objBuilder = (MyObjectBuilder_EnvironmentDefinition)builder;

            BackgroundTexture     = objBuilder.EnvironmentTexture;
            BackgroundOrientation = new MyOrientation(
                MathHelper.ToRadians(objBuilder.EnvironmentOrientation.Yaw),
                MathHelper.ToRadians(objBuilder.EnvironmentOrientation.Pitch),
                MathHelper.ToRadians(objBuilder.EnvironmentOrientation.Roll));

            SmallShipMaxSpeed        = objBuilder.SmallShipMaxSpeed;
            LargeShipMaxSpeed        = objBuilder.LargeShipMaxSpeed;
            SmallShipMaxAngularSpeed = objBuilder.SmallShipMaxAngularSpeed;
            LargeShipMaxAngularSpeed = objBuilder.LargeShipMaxAngularSpeed;
            FogProperties.Deserialize(objBuilder);
            SunProperties.Deserialize(objBuilder);
        }
示例#16
0
        public void Serialize(MyObjectBuilder_EnvironmentDefinition builder)
        {
            builder.SunIntensity = SunIntensity;
            builder.SunDiffuse   = SunDiffuse.ToVector3();
            builder.SunSpecular  = SunSpecular.ToVector3();

            builder.AdditionalSunDirection = new VRage.SerializableVector2[AdditionalSunDirection.Length];
            for (int lightIndex = 0; lightIndex < builder.AdditionalSunDirection.Length; ++lightIndex)
            {
                builder.AdditionalSunDirection[lightIndex] = AdditionalSunDirection[lightIndex];
            }
            builder.BackLightIntensity = AdditionalSunIntensity[0];
            builder.BackLightDiffuse   = AdditionalSunDiffuse[0].ToVector3();

            builder.AmbientColor                = AmbientColor.ToVector3();
            builder.AmbientMultiplier           = AmbientMultiplier;
            builder.EnvironmentAmbientIntensity = EnvironmentAmbientIntensity;
            builder.SunSizeMultiplier           = SunSizeMultiplier;
            builder.BackgroundColor             = BackgroundColor.ToVector3();
            builder.SunMaterial  = SunMaterial;
            builder.SunDirection = BaseSunDirectionNormalized;
        }
        public override MyObjectBuilder_DefinitionBase GetObjectBuilder()
        {
            var result = new MyObjectBuilder_EnvironmentDefinition();
            result.Id = Id;
            result.FogProperties = FogProperties;
            result.SunProperties = SunProperties;
            result.PostProcessSettings = PostProcessSettings;
            result.SSAOSettings = SSAOSettings;
            result.HBAOSettings = HBAOSettings;
            result.ShadowSettings.CopyFrom(ShadowSettings);
            result.SmallShipMaxSpeed = this.SmallShipMaxSpeed;
            result.LargeShipMaxSpeed = this.LargeShipMaxSpeed;
            result.SmallShipMaxAngularSpeed = this.SmallShipMaxAngularSpeed;
            result.LargeShipMaxAngularSpeed = this.LargeShipMaxAngularSpeed;
            result.ContourHighlightColor = this.ContourHighlightColor.ToVector4();
            result.ContourHighlightThickness = this.ContourHighlightThickness;
            result.HighlightPulseInSeconds = this.HighlightPulseInSeconds;
            result.EnvironmentTexture = this.EnvironmentTexture;
            result.EnvironmentOrientation = this.EnvironmentOrientation;

            return result;
        }
        public override MyObjectBuilder_DefinitionBase GetObjectBuilder()
        {
            var result = new MyObjectBuilder_EnvironmentDefinition()
            {
                EnvironmentTexture = this.BackgroundTexture,
                EnvironmentTextureNight = this.BackgroundTextureNight,
                EnvironmentTextureNightPrefiltered = this.BackgroundTextureNightPrefiltered,
                SmallShipMaxSpeed = this.SmallShipMaxSpeed,
                LargeShipMaxSpeed = this.LargeShipMaxSpeed,
				EnvironmentalParticles = this.EnvironmentalParticles,
                SmallShipMaxAngularSpeed = this.m_smallShipMaxAngularSpeed,
                LargeShipMaxAngularSpeed = this.m_largeShipMaxAngularSpeed,
                EnvironmentOrientation = new MyOrientation(
                    MathHelper.ToDegrees(BackgroundOrientation.Yaw),
                    MathHelper.ToDegrees(BackgroundOrientation.Pitch),
                    MathHelper.ToDegrees(BackgroundOrientation.Roll)),
                ContourHighlightColor = this.ContourHighlightColor.ToVector4(),
                ContourHighlightThickness = this.ContourHighlightThickness,
                HighlightPulseInSeconds = this.HighlightPulseInSeconds,

            };
            FogProperties.Serialize(result);
            SunProperties.Serialize(result);
            return result;
        }
        public void Serialize(MyObjectBuilder_EnvironmentDefinition builder)
        {
            builder.SunIntensity = SunIntensity;
            builder.SunDiffuse = SunDiffuse.ToVector3();
            builder.SunSpecular = SunSpecular.ToVector3();

            builder.AdditionalSunDirection = new VRage.SerializableVector2[AdditionalSunDirection.Length];
            for (int lightIndex = 0; lightIndex < builder.AdditionalSunDirection.Length; ++lightIndex)
            {
                builder.AdditionalSunDirection[lightIndex] = AdditionalSunDirection[lightIndex];
            }
            builder.BackLightIntensity = AdditionalSunIntensity[0];
            builder.BackLightDiffuse = AdditionalSunDiffuse[0].ToVector3();

            builder.AmbientColor = AmbientColor.ToVector3();
            builder.AmbientMultiplier = AmbientMultiplier;
            builder.EnvironmentAmbientIntensity = EnvironmentAmbientIntensity;
            builder.SunSizeMultiplier = SunSizeMultiplier;
            builder.BackgroundColor = BackgroundColor.ToVector3();
            builder.SunMaterial = SunMaterial;
            builder.SunDirection = BaseSunDirectionNormalized;
        }
        public void Deserialize(MyObjectBuilder_EnvironmentDefinition builder)
        {
            SunIntensity = builder.SunIntensity;
            SunDiffuse = new Color((Vector3)builder.SunDiffuse);
            SunSpecular = new Color((Vector3)builder.SunSpecular);
            AdditionalSunDirection = new Vector2[Math.Min(builder.AdditionalSunDirection.Length, MyRenderMessageUpdateRenderEnvironment.MaxAdditionalSuns)];
            AdditionalSunDiffuse = new Color[AdditionalSunDirection.Length];
            AdditionalSunIntensity = new float[AdditionalSunDirection.Length];

            for (int lightIndex = 0; lightIndex < AdditionalSunDirection.Length; ++lightIndex)
            {
                AdditionalSunDirection[lightIndex] = builder.AdditionalSunDirection[lightIndex];
                AdditionalSunIntensity[lightIndex] = builder.BackLightIntensity;
                AdditionalSunDiffuse[lightIndex] = new Color((Vector3)builder.BackLightDiffuse);
            }

            AmbientColor = new Color((Vector3)builder.AmbientColor);
            AmbientMultiplier = builder.AmbientMultiplier;
            EnvironmentAmbientIntensity = builder.EnvironmentAmbientIntensity;
            SunSizeMultiplier = builder.SunSizeMultiplier;
            BackgroundColor = new Color((Vector3)builder.BackgroundColor);
            SunMaterial = builder.SunMaterial;
            SunDirectionNormalized = Vector3.Normalize(builder.SunDirection);
            BaseSunDirectionNormalized = SunDirectionNormalized;
        }