Performs a search to ensure that insert keeps next_in_quadrant in sprite_index order
| 369 | |
| 370 | // Performs a search to ensure that insert keeps next_in_quadrant in sprite_index order |
| 371 | void EntityRegistry::EntitySpatialInsert(EntityBase& entity, const CoordsXY& newLoc) |
| 372 | { |
| 373 | const auto newIndex = ComputeSpatialIndex(newLoc); |
| 374 | |
| 375 | auto& spatialVector = gEntitySpatialIndex[newIndex]; |
| 376 | |
| 377 | Algorithm::sortedInsert(spatialVector, entity.id); |
| 378 | |
| 379 | entity.spatialIndex = newIndex; |
| 380 | } |
| 381 | |
| 382 | void EntityRegistry::EntitySpatialRemove(EntityBase& entity) |
| 383 | { |
nothing calls this directly
no test coverage detected