示例#1
0
 /// <summary>
 /// Compute the heights map using LC_Math.PerlinNoiseMap.
 /// </summary>
 /// <param name="chunkPos">Position of the chunk</param>
 /// <returns></returns>
 protected virtual float[,] CreateChunkHeightsMap(Vector2Int chunkPos)
 {
     return(LC_Math.PerlinNoiseMap(
                new Vector2Int(ChunkSize + 3, ChunkSize + 3),        // +1 for top-right edges and +2 for normals computation
                Seed,
                Octaves, Persistance, Lacunarity,
                new Vector2(0, MaxHeight),
                HeightsDivisor,
                (chunkPos.x - 1) * ChunkSize,          // -1 for normals computation (get neighbour chunk edge heights)
                (chunkPos.y - 1) * ChunkSize,          // -1 for normals computation (get neighbour chunk edge heights)
                true));
 }