Removed temporary update commits

This commit is contained in:
Yousef Khadadeh 2025-07-31 09:34:17 +03:00
parent d19b5c4cb0
commit ed3d5f6d51
25 changed files with 125 additions and 163 deletions

View file

@ -459,7 +459,7 @@ namespace SCollision {
return 3;
}
void calculate_bvh_recursive(ColliderCollection<T>& bvhObjects) {
void calculate_bvh_recursive(ColliderCollection<T>& bvhObjects, int maxDepth = -1) {
bvhObjects.recalculate_bounds();
objects.bounds = bvhObjects.bounds;
@ -468,7 +468,7 @@ namespace SCollision {
return;
}
if(bvhObjects.size() <= 2) {
if(bvhObjects.size() <= 2 || maxDepth == 0) {
objects = bvhObjects;
return;
}
@ -492,7 +492,7 @@ namespace SCollision {
}
else {
children.emplace_back();
children.back().calculate_bvh_recursive(parts[i]);
children.back().calculate_bvh_recursive(parts[i], maxDepth - 1);
}
}
}