mirror of
https://github.com/godotengine/godot.git
synced 2025-01-18 20:40:57 +08:00
Merge pull request #2587 from eska014/fix-area2d-mask-matching
Fix Area/Area2D mask matching
This commit is contained in:
commit
a871fc9112
@ -34,10 +34,10 @@
|
||||
|
||||
_FORCE_INLINE_ static bool _match_object_type_query(CollisionObjectSW *p_object, uint32_t p_layer_mask, uint32_t p_type_mask) {
|
||||
|
||||
if ((p_object->get_layer_mask()&p_layer_mask)==0)
|
||||
return false;
|
||||
if (p_object->get_type()==CollisionObjectSW::TYPE_AREA)
|
||||
return p_type_mask&PhysicsDirectSpaceState::TYPE_MASK_AREA;
|
||||
|
||||
if (p_object->get_type()==CollisionObjectSW::TYPE_AREA && !(p_type_mask&PhysicsDirectSpaceState::TYPE_MASK_AREA))
|
||||
if ((p_object->get_layer_mask()&p_layer_mask)==0)
|
||||
return false;
|
||||
|
||||
BodySW *body = static_cast<BodySW*>(p_object);
|
||||
|
@ -36,8 +36,8 @@ _FORCE_INLINE_ static bool _match_object_type_query(CollisionObject2DSW *p_objec
|
||||
if ((p_object->get_layer_mask()&p_layer_mask)==0)
|
||||
return false;
|
||||
|
||||
if (p_object->get_type()==CollisionObject2DSW::TYPE_AREA && !(p_type_mask&Physics2DDirectSpaceState::TYPE_MASK_AREA))
|
||||
return false;
|
||||
if (p_object->get_type()==CollisionObject2DSW::TYPE_AREA)
|
||||
return p_type_mask&Physics2DDirectSpaceState::TYPE_MASK_AREA;
|
||||
|
||||
Body2DSW *body = static_cast<Body2DSW*>(p_object);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user