public static void SetDefaults() { MySolarSystemArea defaults = MySolarSystemConstants.GetDefaultArea(); SunProperties = defaults.SectorData.SunProperties; FogProperties = defaults.SectorData.FogProperties; DebrisProperties = defaults.SectorData.DebrisProperties; ImpostorProperties = defaults.SectorData.ImpostorProperties; ParticleDustProperties = defaults.SectorData.ParticleDustProperties; GodRaysProperties = defaults.SectorData.GodRaysProperties; BackgroundTexture = defaults.SectorData.BackgroundTexture; }
/// <param name="interpolator">0 - use this object, 1 - use other object</param> public MyParticleDustProperties InterpolateWith(MyParticleDustProperties otherProperties, float interpolator) { var result = new MyParticleDustProperties(); result.DustFieldCountInDirectionHalf = MathHelper.Lerp(DustFieldCountInDirectionHalf, otherProperties.DustFieldCountInDirectionHalf, interpolator); result.DistanceBetween = MathHelper.Lerp(DistanceBetween, otherProperties.DistanceBetween, interpolator); result.AnimSpeed = MathHelper.Lerp(AnimSpeed, otherProperties.AnimSpeed, interpolator); result.Color = Color.Lerp(Color, otherProperties.Color, interpolator); result.Enabled = MathHelper.Lerp(Enabled ? 1 : 0, otherProperties.Enabled ? 1 : 0, interpolator) > 0.5f; result.DustBillboardRadius = interpolator <= 0.5f ? DustBillboardRadius : otherProperties.DustBillboardRadius; result.Texture = interpolator <= 0.5f ? Texture : otherProperties.Texture; return(result); }
/// <param name="interpolator">0 - use this object, 1 - use other object</param> public MyParticleDustProperties InterpolateWith(MyParticleDustProperties otherProperties, float interpolator) { var result = new MyParticleDustProperties(); result.DustFieldCountInDirectionHalf = MathHelper.Lerp(DustFieldCountInDirectionHalf, otherProperties.DustFieldCountInDirectionHalf, interpolator); result.DistanceBetween = MathHelper.Lerp(DistanceBetween, otherProperties.DistanceBetween, interpolator); result.AnimSpeed = MathHelper.Lerp(AnimSpeed, otherProperties.AnimSpeed, interpolator); result.Color = Color.Lerp(Color, otherProperties.Color, interpolator); result.Enabled = MathHelper.Lerp(Enabled ? 1 : 0, otherProperties.Enabled ? 1 : 0, interpolator) > 0.5f; result.DustBillboardRadius = interpolator <= 0.5f ? DustBillboardRadius : otherProperties.DustBillboardRadius; result.Texture = interpolator <= 0.5f ? Texture : otherProperties.Texture; return result; }