Ejemplo n.º 1
0
 private void updateChunk(bool[] data, int chunkSize, RayTraceChunk chunk)
 {
     chunk.clearAll();
     for (int k = 0; k < chunkSize; k++)
     {
         for (int j = 0; j < chunkSize; j++)
         {
             for (int i = 0; i < chunkSize; i++)
             {
                 if (data[k * chunkSize * chunkSize + j * chunkSize + i])
                 {
                     chunk.setBlock(i, j, k);
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public void create(int chunkNumX, int chunkNumY, int chunkNumZ, int chunkSize)
 {
     curStartChunkX = curStartChunkY = curStartChunkZ = -65536;
     sizeX          = chunkNumX; sizeY = chunkNumY; sizeZ = chunkNumZ;
     this.chunkSize = chunkSize;
     chunks         = new RayTraceChunk[sizeX, sizeY, sizeZ];
     for (int k = 0; k < sizeZ; k++)
     {
         for (int j = 0; j < sizeY; j++)
         {
             for (int i = 0; i < sizeX; i++)
             {
                 RayTraceChunk temp = new RayTraceChunk();
                 temp.create(chunkSize, chunkSize, chunkSize);
                 temp.clearAll();
                 chunks[i, j, k] = temp;
             }
         }
     }
 }