コード例 #1
0
 public HeightMap(int seed, HeightMapConfig config, FastPerlinNoiseConfig noiseConfig)
 {
     this.config      = config;
     this.noiseConfig = noiseConfig;
     //this.noise = new ZeroNoiseMap(noiseConfig.resolution, seed);
     this.noise = new FastPerlinNoise(seed, noiseConfig);
     modifyNoise();
 }
コード例 #2
0
 public HeightMap(int seed, HeightMapConfig config, FastPerlinNoiseConfig noiseConfig, ErosionConfig erosionConfig)
 {
     this._config      = config;
     this._noiseConfig = noiseConfig;
     //this.noise = new ZeroNoiseMap(noiseConfig.resolution, seed);
     this._noise         = new FastPerlinNoise(seed, this._noiseConfig);
     this._erosionConfig = erosionConfig;
     ModifyNoise();
 }
コード例 #3
0
        public SquareRegion(int seed,
                            RegionGenConfig regionGenConfig,
                            HeightMapConfig heightMapConfig,
                            FastPerlinNoiseConfig noiseConfig
                            ) : base(seed)
        {
            // ErosionConfig erosionConfig

            this.regionGenConfig = regionGenConfig;

            // compute required array dimensions
            this.gridRadius = computeGridRadius();

            noiseConfig.resolution = (int)(this.gridRadius * heightMapConfig.resolutionScale) + 1;
            this.heightMap         = new HeightMap(seed, heightMapConfig, noiseConfig); //erosionConfig);

            this.tileSize = regionGenConfig.tileSize;

            computeTileCenterCoords();
            computeElevationParameters();

            Debug.Log("Generated square region.");
        }