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)
 {
     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 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 = SunDirectionNormalized;
 }
        public override MyObjectBuilder_DefinitionBase GetObjectBuilder()
        {
            var result = new MyObjectBuilder_EnvironmentDefinition()
            {
                EnvironmentTexture = this.BackgroundTexture,
                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)),
            };
            FogProperties.Serialize(result);
            SunProperties.Serialize(result);
            return result;
        }