This could be a huge undertaking which might require several PRs to complete it, feel free to split this into smaller issues.
Goal
Right now, a Spatree cannot be updated. Every changes to the scene will trigger a full rebuild of the entire Spatree. This might not be ideal for large scenes with dynamic updates.
The construction of BVH should still be recreated every (updated) frame, we only focus on incrementally updating the leaf nodes and a way for global bounds to be defined by the user + handling cases where inserted rects are out of the given bound.
Steps to achieve the goal
This could be a huge undertaking which might require several PRs to complete it, feel free to split this into smaller issues.
Goal
Right now, a
Spatreecannot be updated. Every changes to the scene will trigger a full rebuild of the entireSpatree. This might not be ideal for large scenes with dynamic updates.The construction of BVH should still be recreated every (updated) frame, we only focus on incrementally updating the leaf nodes and a way for global bounds to be defined by the user + handling cases where inserted rects are out of the given bound.
Steps to achieve the goal
BTreeSet/BTreeMapequivalent for storingSparseMapmapped rect ids, sorted viaMortonCodeNote*: Building LBVH still relies on
MortonCodein a linear data structure (e.g. aVec) so we might need a better way to store them.