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

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