[3.x] BVH - fix not refitting upward from leaf nodes
Fix leaf node possibly not updating aabb due to wrong node id. Additionally, when requesting a new leaf, mark `dirty` as `false` in `clear()`.
This commit is contained in:
parent
5271c971f3
commit
01c60dc9ee
2 changed files with 2 additions and 2 deletions
|
@ -134,7 +134,7 @@ void refit_branch(uint32_t p_node_id) {
|
||||||
TLeaf &leaf = _node_get_leaf(tnode);
|
TLeaf &leaf = _node_get_leaf(tnode);
|
||||||
if (leaf.is_dirty()) {
|
if (leaf.is_dirty()) {
|
||||||
leaf.set_dirty(false);
|
leaf.set_dirty(false);
|
||||||
refit_upward(p_node_id);
|
refit_upward(rp.node_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // while more nodes to pop
|
} // while more nodes to pop
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
|
|
||||||
void clear() {
|
void clear() {
|
||||||
num_items = 0;
|
num_items = 0;
|
||||||
set_dirty(true);
|
set_dirty(false);
|
||||||
}
|
}
|
||||||
bool is_full() const { return num_items >= MAX_ITEMS; }
|
bool is_full() const { return num_items >= MAX_ITEMS; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue