// This method does same thing as GetCell(), but doesn't do it now or immediately. // Instead it adds data cells that are needed to be precalculated to the queue so later they can be calculated on multiple cores. public static MyVoxelCacheCellData GetCellLater(MyVoxelMap voxelMap, ref MyMwcVector3Int cellCoord) { lock (Locker) { MyVoxelCacheCellData cachedDataCell = GetCellFromCache(voxelMap.VoxelMapId, ref cellCoord); // If cell isn't in the cache yet if (cachedDataCell == null) { // If cell and its neighborhood is completely full or completely empty, result of precalc will be zero-triangles, so we can skip precalc. // It can speedup precalc because then we don't have to check every voxel if (voxelMap.IsDataCellCompletelyFullOrCompletelyEmpty(ref cellCoord) == false) { // Cell may have triangles, so add it to cache and run precalc cachedDataCell = AddCell(voxelMap.VoxelMapId, ref cellCoord); MyVoxelPrecalc.AddToQueue(MyLodTypeEnum.LOD0, voxelMap, cachedDataCell, cellCoord.X * MyVoxelConstants.VOXEL_DATA_CELL_SIZE_IN_VOXELS, cellCoord.Y * MyVoxelConstants.VOXEL_DATA_CELL_SIZE_IN_VOXELS, cellCoord.Z * MyVoxelConstants.VOXEL_DATA_CELL_SIZE_IN_VOXELS); } } // I commented out this condition "(cachedDataCell != null)" because now I think we want to move-up in priority list // all data cells, independently of whether they contain or don't contain triangles if (cachedDataCell != null) { UpdateCell(voxelMap.VoxelMapId, ref cellCoord); } return cachedDataCell; } }