/// <summary> /// Marks cells to load or keep loaded inside the bounds /// </summary> /// <param name="bounds">Spherical bounds</param> public void MarkToLoadCellsInBounds(BoundingSphereD bounds) { BoundingBoxD box = BoundingBoxD.CreateFromSphere(bounds); Vector3I cellId = Vector3I.Floor(box.Min / m_cellSize); for (var it = GetCellsIterator(box); it.IsValid(); it.GetNext(out cellId)) { if (m_toLoadCells.Contains(cellId)) { continue; } BoundingBoxD cellBounds = new BoundingBoxD(cellId * m_cellSize, (cellId + 1) * m_cellSize); if (bounds.Contains(cellBounds) == ContainmentType.Disjoint) { continue; } m_toLoadCells.Add(cellId); } m_toLoadCells.ApplyAdditions(); }