Esempio n. 1
0
        public Graph(IEnumerable <Vector2> points, Voronoi voronoi, int width, int height, float lakeThreshold)
        {
            Width  = width;
            Height = height;
            inside = IslandShape.makePerlin();

            BuildGraph(points, voronoi);
            AssignCornerElevations();
            AssignOceanCoastAndLand(lakeThreshold);
            RedistributeElevations();

            AssignPolygonElevations();

            // Determine downslope paths.
            CalculateDownslopes();

            // Determine watersheds: for every corner, where does it flow
            // out into the ocean?
            CalculateWatersheds();

            // Create rivers.
            CreateRivers();

            // Determine moisture at corners, starting at rivers
            // and lakes, but not oceans. Then redistribute
            // moisture to cover the entire range evenly from 0.0
            // to 1.0. Then assign polygon moisture as the average
            // of the corner moisture.
            AssignCornerMoisture();
            RedistributeMoisture();
            AssignPolygonMoisture();

            centers.ForEach(p => p.biome = GetBiome(p));
        }
Esempio n. 2
0
 public Graph(IEnumerable <Vector2> points, Voronoi voronoi, int width, int height, float lakeThreshold)
 {
     Init(IslandShape.makePerlin(), points, voronoi, width, height, lakeThreshold);
 }