コード例 #1
0
ファイル: ChunkGenerator.cs プロジェクト: Alan-Baylis/Caravan
    public void Generate(Action callback, Vector2 inChunkCoords, World.WorldGenData inWorldGenData, ChunkGenerator inChunkGenerator)
    {
        _tempMap = Noise.GenerateNoiseData
                   (
            inWorldGenData.tempSeed,
            inWorldGenData.chunkSize,
            inChunkCoords,
            inWorldGenData.tempOctaves,
            inWorldGenData.tempScale,
            inWorldGenData.tempPersistance,
            inWorldGenData.tempLacunarity,
            inWorldGenData.tempRedistribution
                   );

        _humidMap = Noise.GenerateNoiseData
                    (
            inWorldGenData.humidSeed,
            inWorldGenData.chunkSize,
            inChunkCoords,
            inWorldGenData.humidOctaves,
            inWorldGenData.humidScale,
            inWorldGenData.humidPersistance,
            inWorldGenData.humidLacunarity,
            inWorldGenData.humidRedistribution
                    );

        _heightMap = Noise.GenerateNoiseData
                     (
            inWorldGenData.heightSeed,
            inWorldGenData.chunkSize,
            inChunkCoords,
            inWorldGenData.heightOctaves,
            inWorldGenData.heightScale,
            inWorldGenData.heightPersistance,
            inWorldGenData.heightLacunarity,
            inWorldGenData.heightRedistribution
                     );

        _falloffMap = Noise.GenerateNoiseData
                      (
            inWorldGenData.falloffSeed,
            inWorldGenData.chunkSize,
            inChunkCoords,
            inWorldGenData.falloffOctaves,
            inWorldGenData.falloffScale,
            inWorldGenData.falloffPersistance,
            inWorldGenData.falloffLacunarity,
            inWorldGenData.falloffRedistribution
                      );

        _falloffMap = Noise.GenerateFalloffMap(_falloffMap);

        _heightMap = Noise.ApplyFalloffMap(_heightMap, _falloffMap);

        lock (inChunkGenerator.noiseDataThreadInfoQueue)
            inChunkGenerator.noiseDataThreadInfoQueue.Enqueue(callback);
    }