Esempio n. 1
0
        public static double CalculatePlanetTepmeratureMaximum(GalaxyProceduralGeneratorSettings settings, double distanceToStar, double starTemperature)
        {
            var starTemperatureNormalized = (starTemperature - settings.StarTemperatureMinimum) / (settings.StarTemperatureMaximum - settings.StarTemperatureMinimum);
            var distanceNormalized        = (distanceToStar - settings.PlanetDistanceToStarMinimum) / (settings.PlanetDistanceToStarMaximum - settings.PlanetDistanceToStarMinimum);

            return(settings.PlanetTemperatureMinimum + (settings.PlanetTemperatureMaximum - settings.PlanetTemperatureMinimum) * distanceNormalized * starTemperatureNormalized);
        }
Esempio n. 2
0
        public static double CalaculatePlanetAtmosphere(GalaxyProceduralGeneratorSettings settings, double mass, double maxTemperature)
        {
            var massNormalized        = (mass - settings.PlanetMassMinimum) / (settings.PlanetMassMaximum - settings.PlanetMassMinimum);
            var temperatureNormalized = 1 - (maxTemperature - settings.PlanetTemperatureMinimum) / (settings.PlanetTemperatureMaximum - settings.PlanetTemperatureMinimum);

            return(massNormalized * temperatureNormalized);
        }
Esempio n. 3
0
        public static double CalculateStarTemeperature(GalaxyProceduralGeneratorSettings settings, double mass, double radius)
        {
            mass   -= settings.StarMassMinimum;
            radius -= settings.StarRadiusMinimum;
            var massMultipler         = mass / (settings.StarMassMaximum - settings.StarMassMinimum);
            var radiusMultipler       = 1 - (radius / (settings.StarRadiusMaximum - settings.StarRadiusMinimum));
            var temperatureFromMass   = (settings.StarTemperatureMaximum - settings.StarTemperatureMinimum) * massMultipler * .5;
            var temperatureFromRadius = (settings.StarTemperatureMaximum - settings.StarTemperatureMinimum) * radiusMultipler * .5;

            return(settings.StarTemperatureMinimum + temperatureFromMass + temperatureFromRadius);
        }
Esempio n. 4
0
 public static bool CalculateIsPlanetHasAtmosphere(GalaxyProceduralGeneratorSettings settings, double mass, double maxTemperature)
 {
     return(CalaculatePlanetAtmosphere(settings, maxTemperature, maxTemperature) > _planetAtmosphere);
 }
Esempio n. 5
0
        public static double CalculatePlanetTemperatureMinimum(GalaxyProceduralGeneratorSettings settings, double mass, double distanceToStar, double starTemperature)
        {
            var maxTemp = CalculatePlanetTepmeratureMaximum(settings, distanceToStar, starTemperature);

            return(maxTemp * (1 - Math.Pow(CalaculatePlanetAtmosphere(settings, mass, maxTemp), 30)));
        }
Esempio n. 6
0
 public static int CalculateProceruralSeed(GalaxyProceduralGeneratorSettings settings, int x, int y, int z)
 {
     return((z + y * settings.ZWidth + x * settings.ZWidth * settings.YWidth) * settings.Seed);
 }
Esempio n. 7
0
 public GalaxyProceduralGeneratorSettingsFluentBuilder(GalaxyProceduralGeneratorSettings settings)
 {
     this.settings = settings;
 }
Esempio n. 8
0
        public static ISeed Init()
        {
            var settings = new GalaxyProceduralGeneratorSettings();

            return(new GalaxyProceduralGeneratorSettingsFluentBuilder(settings));
        }