Пример #1
0
    protected override void Setup(int wX, int wZ)
    {
        rand = new System.Random(wX * 10 + wZ * 1000);
        terrainNoise.GenerateNoise(wX, wZ);
        islandNoise.GenerateNoise(wX, wZ);

        Vector3i worldPos = new Vector3i(wX, 0, wZ);

        terrainNoise3D.GenerateNoise(worldPos);
        islandNoise3D.GenerateNoise(worldPos);
        caveNoise3D.GenerateNoise(worldPos);
    }
Пример #2
0
    public IEnumerator Generate(int cx, int cz)
    {
        terrainNoise.GenerateNoise(cx * Chunk.SIZE_X, cz * Chunk.SIZE_Z);
        islandNoise.GenerateNoise(cx * Chunk.SIZE_X, cz * Chunk.SIZE_Z);

        for (int cy = 0; true; cy++)
        {
            Vector3i worldPos = Chunk.ToWorldPosition(new Vector3i(cx, cy, cz), Vector3i.zero);
            terrainNoise3D.GenerateNoise(worldPos);
            islandNoise3D.GenerateNoise(worldPos);
            caveNoise3D.GenerateNoise(worldPos);

            bool generated = GenerateChunk(new Vector3i(cx, cy, cz));
            if (!generated)
            {
                break;
            }

            yield return(null);
        }
    }
Пример #3
0
    public IEnumerator Generate(int cx, int cz)
    {
        terrainNoise.GenerateNoise(cx * OpenCog.Map.OCChunk.SIZE_X, cz * OpenCog.Map.OCChunk.SIZE_Z);
        islandNoise.GenerateNoise(cx * OpenCog.Map.OCChunk.SIZE_X, cz * OpenCog.Map.OCChunk.SIZE_Z);

        for (int cy = 0; true; cy++)
        {
            Vector3i worldPos = OpenCog.Map.OCChunk.ToWorldPosition(new Vector3i(cx, cy, cz), Vector3i.zero);

            //System.Console.WriteLine(OCLogSymbol.DETAILEDINFO +"worldPos = [" + worldPos.x + ", " + worldPos.y + ", " + worldPos.z + "]");

            terrainNoise3D.GenerateNoise(worldPos);
            islandNoise3D.GenerateNoise(worldPos);
            caveNoise3D.GenerateNoise(worldPos);

            bool generated = GenerateChunk(new Vector3i(cx, cy, cz));
            if (!generated)
            {
                break;
            }

            yield return(null);
        }
    }
Пример #4
0
    public IEnumerator Generate(int cx, int cz)
    {
        terrainNoise.GenerateNoise(cx * OpenCog.Map.OCChunk.SIZE_X, cz * OpenCog.Map.OCChunk.SIZE_Z);
        islandNoise.GenerateNoise(cx * OpenCog.Map.OCChunk.SIZE_X, cz * OpenCog.Map.OCChunk.SIZE_Z);

        for (int cy = 0; true; cy++)
        {
            Vector3i worldPos = OpenCog.Map.OCChunk.ToWorldPosition(new Vector3i(cx, cy, cz), Vector3i.zero);

            //OCLogger.Debugging("worldPos = [" + worldPos.x + ", " + worldPos.y + ", " + worldPos.z + "]");

            terrainNoise3D.GenerateNoise(worldPos);
            islandNoise3D.GenerateNoise(worldPos);
            caveNoise3D.GenerateNoise(worldPos);

            bool generated = GenerateChunk(new Vector3i(cx, cy, cz));
            if (!generated)
            {
                break;
            }

            yield return(null);
        }
    }
Пример #5
0
 public static void generateHeightNoise(int x, int z)
 {
     heightNoise.GenerateNoise(x, z);
 }