MCPcopy Create free account
hub / github.com/PacktPublishing/3D-Graphics-Rendering-Cookbook / shiftMapIndices

Function shiftMapIndices

shared/scene/Scene.cpp:445–454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

443}
444
445void 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
457void deleteSceneNodes(Scene& scene, const std::vector<uint32_t>& nodesToDelete)

Callers 1

deleteSceneNodesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected