diff options
Diffstat (limited to 'servers/physics/collision_object_sw.h')
-rw-r--r-- | servers/physics/collision_object_sw.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/servers/physics/collision_object_sw.h b/servers/physics/collision_object_sw.h index 592c84e667..bc71c2709b 100644 --- a/servers/physics/collision_object_sw.h +++ b/servers/physics/collision_object_sw.h @@ -53,6 +53,7 @@ private: RID self; ObjectID instance_id; uint32_t layer_mask; + uint32_t collision_mask; struct Shape { @@ -136,6 +137,13 @@ public: _FORCE_INLINE_ void set_layer_mask(uint32_t p_mask) { layer_mask=p_mask; } _FORCE_INLINE_ uint32_t get_layer_mask() const { return layer_mask; } + _FORCE_INLINE_ void set_collision_mask(uint32_t p_mask) { collision_mask=p_mask; } + _FORCE_INLINE_ uint32_t get_collision_mask() const { return collision_mask; } + + _FORCE_INLINE_ bool test_collision_mask(CollisionObjectSW* p_other) const { + return layer_mask&p_other->collision_mask || p_other->layer_mask&collision_mask; + } + void remove_shape(ShapeSW *p_shape); void remove_shape(int p_index); |