public Region() { var indexedSize = (int)Mathf.Pow(REGION_SIZE, 3); var upperBound = (int)Mathf.Pow(REGION_SIZE, 2); this.chunks = new Chunk[indexedSize]; this.Bounds = new CubeBounds(0, 0, 0, upperBound, upperBound, upperBound); }
public Chunk(IntVector3 position) { var indexedSize = (int) Mathf.Pow(CHUNK_SIZE, 3); var chunkPos = ClampAbsPosition(position); this.cells = new CellDefinition[indexedSize]; this.dirtyCells = new List<CellDefinition>(128); this.Bounds = new CubeBounds(chunkPos, CHUNK_SIZE); }