feat: enhance SceneSync update method to process entity deletions after updates

This commit is contained in:
MayaTheShy
2025-11-08 16:00:27 -05:00
parent d0add2e4ff
commit 2bc3d6fd03

View File

@@ -21,5 +21,15 @@ void SceneSync::update(StardustBridge& stardust, OverteClient& overte) {
stardust.updateNodeTransform(it->second, e.transform);
}
}
// Process deletions after updates to avoid create-then-delete thrash.
auto deleted = overte.consumeDeletedEntities();
for (auto entId : deleted) {
auto it = s_entityNodeMap.find(entId);
if (it != s_entityNodeMap.end()) {
stardust.removeNode(it->second);
s_entityNodeMap.erase(it);
}
}
}