public MyVoxelPrecalcTaskItem(MyLodTypeEnum type, MyVoxelMap voxelMap, MyVoxelGeometry.CellData cache, Vector3I voxelStart)
 {
     Type = type;
     VoxelMap = voxelMap;
     Cache = cache;
     VoxelStart = voxelStart;
 }
        /// <param name="minVoxelChanged">Inclusive min.</param>
        /// <param name="maxVoxelChanged">Inclusive max.</param>
        internal void InvalidateRange(Vector3I minVoxelChanged, Vector3I maxVoxelChanged)
        {
            Vector3I minCellChanged, maxCellChanged;

            MyVoxelGeometry.ComputeCellCoord(ref minVoxelChanged, out minCellChanged);
            MyVoxelGeometry.ComputeCellCoord(ref maxVoxelChanged, out maxCellChanged);
            Vector3I cell;

            for (cell.X = minCellChanged.X; cell.X <= maxCellChanged.X; cell.X++)
            {
                for (cell.Y = minCellChanged.Y; cell.Y <= maxCellChanged.Y; cell.Y++)
                {
                    for (cell.Z = minCellChanged.Z; cell.Z <= maxCellChanged.Z; cell.Z++)
                    {
                        m_physicsChangedCells.Add(cell);
                    }
                }
            }
            m_physicsDirty = true;
        }
 public static void AddToQueue(
     MyLodTypeEnum type,
     MyVoxelMap voxelMap,
     MyVoxelGeometry.CellData cache,
     int voxelStartX, int voxelStartY, int voxelStartZ)
 {
     Debug.Assert(Thread.CurrentThread == MySandboxGame.Static.UpdateThread, "Only update thread should queue voxel precalc.");
     MyVoxelPrecalcTaskItem a = new MyVoxelPrecalcTaskItem(type, voxelMap, cache, new Vector3I(voxelStartX, voxelStartY, voxelStartZ));
     Tasks.Enqueue(a);
 }