|
@@ -1111,6 +1111,10 @@ bool Space2DSW::test_body_motion(Body2DSW *p_body, const Transform2D &p_from, co
|
|
|
}
|
|
|
|
|
|
void *Space2DSW::_broadphase_pair(CollisionObject2DSW *A, int p_subindex_A, CollisionObject2DSW *B, int p_subindex_B, void *p_self) {
|
|
|
+ if (!A->test_collision_mask(B)) {
|
|
|
+ return nullptr;
|
|
|
+ }
|
|
|
+
|
|
|
CollisionObject2DSW::Type type_A = A->get_type();
|
|
|
CollisionObject2DSW::Type type_B = B->get_type();
|
|
|
if (type_A > type_B) {
|
|
@@ -1143,6 +1147,10 @@ void *Space2DSW::_broadphase_pair(CollisionObject2DSW *A, int p_subindex_A, Coll
|
|
|
}
|
|
|
|
|
|
void Space2DSW::_broadphase_unpair(CollisionObject2DSW *A, int p_subindex_A, CollisionObject2DSW *B, int p_subindex_B, void *p_data, void *p_self) {
|
|
|
+ if (!p_data) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
Space2DSW *self = (Space2DSW *)p_self;
|
|
|
self->collision_pairs--;
|
|
|
Constraint2DSW *c = (Constraint2DSW *)p_data;
|