1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-28 16:07:14 +00:00

BVH - Sync BVH with 3.x

Templated mask checks and generic NUM_TREES
Fix leaking leaves
This commit is contained in:
lawnjelly
2022-02-04 16:46:10 +00:00
parent 8495be9cec
commit f8eaab5b47
20 changed files with 744 additions and 257 deletions

View File

@@ -1008,11 +1008,8 @@ bool GodotSpace3D::test_body_motion(GodotBody3D *p_body, const PhysicsServer3D::
return collided;
}
// Assumes a valid collision pair, this should have been checked beforehand in the BVH or octree.
void *GodotSpace3D::_broadphase_pair(GodotCollisionObject3D *A, int p_subindex_A, GodotCollisionObject3D *B, int p_subindex_B, void *p_self) {
if (!A->interacts_with(B)) {
return nullptr;
}
GodotCollisionObject3D::Type type_A = A->get_type();
GodotCollisionObject3D::Type type_B = B->get_type();
if (type_A > type_B) {