Esempio n. 1
0
 private void CalculateVariables()
 {
     Current_Mode = LOD_Mode.Empty;
     Max_Mode     = LOD_Mode.Empty;
     Depth        = 10;
     ChunkSizeX   = (int)(ChunkMeterSizeX * VoxelsPerMeter);
     ChunkSizeY   = (int)(ChunkMeterSizeY * VoxelsPerMeter);
     ChunkSizeZ   = (int)(ChunkMeterSizeZ * VoxelsPerMeter);
     half         = ((1.0f / (float)VoxelsPerMeter) / 2.0f);
     xSideLength  = ChunkMeterSizeX / (float)ChunkSizeX;
     ySideLength  = ChunkMeterSizeY / (float)ChunkSizeY;
     zSideLength  = ChunkMeterSizeZ / (float)ChunkSizeZ;
     skipDist     = Mathf.RoundToInt(1 / (float)VoxelsPerMeter);
     locOffset    = new Vector3[8]
     {
         new Vector3(0, 0, zSideLength),
         new Vector3(xSideLength, 0, zSideLength),
         new Vector3(xSideLength, 0, 0),
         new Vector3(0, 0, 0),
         new Vector3(0, ySideLength, zSideLength),
         new Vector3(xSideLength, ySideLength, zSideLength),
         new Vector3(xSideLength, ySideLength, 0),
         new Vector3(0, ySideLength, 0),
     };
     globalOffsets = new Vector3Int[8]
     {
         new Vector3Int(0, 0, 1) * skipDist,
         new Vector3Int(1, 0, 1) * skipDist,
         new Vector3Int(1, 0, 0) * skipDist,
         new Vector3Int(0, 0, 0) * skipDist,
         new Vector3Int(0, 1, 1) * skipDist,
         new Vector3Int(1, 1, 1) * skipDist,
         new Vector3Int(1, 1, 0) * skipDist,
         new Vector3Int(0, 1, 0) * skipDist,
     };
     //AllocateBlockArray(ChunkSizeX, ChunkSizeY, ChunkSizeZ);
     Initialized = true;
 }