| 443 | } |
| 444 | |
| 445 | void shiftMapIndices(std::unordered_map<uint32_t, uint32_t>& items, const std::vector<int>& newIndices) |
| 446 | { |
| 447 | std::unordered_map<uint32_t, uint32_t> newItems; |
| 448 | for (const auto& m: items) { |
| 449 | int newIndex = newIndices[m.first]; |
| 450 | if (newIndex != -1) |
| 451 | newItems[newIndex] = m.second; |
| 452 | } |
| 453 | items = newItems; |
| 454 | } |
| 455 | |
| 456 | // Approximately an O ( N * Log(N) * Log(M)) algorithm (N = scene.size, M = nodesToDelete.size) to delete a collection of nodes from scene graph |
| 457 | void deleteSceneNodes(Scene& scene, const std::vector<uint32_t>& nodesToDelete) |