예제 #1
0
    public void InitChunkFields()
    {
        chunks = new FieldChunk[ChunkFieldN, ChunkFieldN];

        float chunkAspectX = (1.0f / (float)ChunkFieldN);
        float chunkAspectY = (1.0f / (float)ChunkFieldN);

        int chunkSize = N / ChunkFieldN;;

        for (int i = 0; i < ChunkFieldN; ++i)
        {
            for (int j = 0; j < ChunkFieldN; ++j)
            {
                int beginX = (int)((float)i * (float)N * chunkAspectX);
                int beginY = (int)((float)j * (float)N * chunkAspectY);
                chunks[i, j] = new FieldChunk(beginX, beginY, chunkSize);
            }
        }
    }
예제 #2
0
    public void InitChunkFields()
    {
        chunks = new FieldChunk[ChunkFieldN, ChunkFieldN];

        float chunkAspectX = (1.0f/(float)ChunkFieldN);
        float chunkAspectY = (1.0f/(float)ChunkFieldN);

        int chunkSize = N / ChunkFieldN;;
        for (int i = 0; i < ChunkFieldN; ++i)
        {
            for (int j = 0; j < ChunkFieldN; ++j)
            {
                int beginX = (int)((float)i * (float)N * chunkAspectX);
                int beginY = (int)((float)j * (float)N * chunkAspectY);
                chunks[i,j] = new FieldChunk(beginX, beginY, chunkSize);
            }
        }
    }