public void ClearChunk(VoxelChunk chunk) { InstancedChunk instancedChunk; if (instancedChunks.TryGetValue(chunk, out instancedChunk)) { instancedChunk.Clear(); rebuild = true; } }
BatchedCell GetBatchedCell(VoxelChunk chunk) { Vector3 pos = chunk.position; int cellX, cellY, cellZ; FastMath.FloorToInt(pos.x / CELL_SIZE, pos.y / CELL_SIZE, pos.z / CELL_SIZE, out cellX, out cellY, out cellZ); pos.x = cellX; pos.y = cellY; pos.z = cellZ; BatchedCell cell; if (!cells.TryGetValue(pos, out cell)) { cell = new BatchedCell(pos, CELL_SIZE); cells.Add(pos, cell); } return(cell); }