diff options
Diffstat (limited to 'servers/physics/area_pair_sw.cpp')
-rw-r--r-- | servers/physics/area_pair_sw.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/servers/physics/area_pair_sw.cpp b/servers/physics/area_pair_sw.cpp index c6bf6114a0..24f3b75ca5 100644 --- a/servers/physics/area_pair_sw.cpp +++ b/servers/physics/area_pair_sw.cpp @@ -32,6 +32,11 @@ bool AreaPairSW::setup(float p_step) { + if (!area->test_collision_mask(body)) { + colliding = false; + return false; + } + bool result = CollisionSolverSW::solve_static(body->get_shape(body_shape),body->get_transform() * body->get_shape_transform(body_shape),area->get_shape(area_shape),area->get_transform() * area->get_shape_transform(area_shape),NULL,this); if (result!=colliding) { @@ -100,6 +105,11 @@ AreaPairSW::~AreaPairSW() { bool Area2PairSW::setup(float p_step) { + if (!area_a->test_collision_mask(area_b)) { + colliding = false; + return false; + } + // bool result = area_a->test_collision_mask(area_b) && CollisionSolverSW::solve(area_a->get_shape(shape_a),area_a->get_transform() * area_a->get_shape_transform(shape_a),Vector2(),area_b->get_shape(shape_b),area_b->get_transform() * area_b->get_shape_transform(shape_b),Vector2(),NULL,this); bool result = CollisionSolverSW::solve_static(area_a->get_shape(shape_a),area_a->get_transform() * area_a->get_shape_transform(shape_a),area_b->get_shape(shape_b),area_b->get_transform() * area_b->get_shape_transform(shape_b),NULL,this); |