Selection cache is also updated when objects are updated

This commit is contained in:
Yousef Khadadeh 2025-07-31 19:28:18 +03:00
parent 069fc66565
commit 0b1cc8d4c2
8 changed files with 37 additions and 8 deletions

View file

@ -165,14 +165,14 @@ void DrawingProgramCache::traverse_bvh_run_function_recursive(const std::shared_
}
}
void DrawingProgramCache::preupdate_component(const CollabListType::ObjectInfoPtr& c, const std::optional<SCollision::AABB<WorldScalar>>& aabb) {
void DrawingProgramCache::preupdate_component(const CollabListType::ObjectInfoPtr& c) {
auto parentBvhNode = c->obj->parentBvhNode.lock();
if(parentBvhNode) {
unsortedComponents.emplace_back(c);
std::erase(parentBvhNode->components, c);
c->obj->parentBvhNode.reset();
}
invalidate_cache_at_optional_aabb_before_pos(aabb, c->pos);
invalidate_cache_at_optional_aabb_before_pos(c->obj->worldAABB, c->pos);
}
void DrawingProgramCache::build_bvh_node(const std::shared_ptr<DrawingProgramCacheBVHNode>& bvhNode, const std::vector<CollabListType::ObjectInfoPtr>& components) {