diff options
author | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2016-04-09 21:54:09 +0300 |
---|---|---|
committer | Bojidar Marinov <bojidar.marinov.bg@gmail.com> | 2016-04-09 22:11:12 +0300 |
commit | f7c3d6329cdc9c21c205f1522813090313a422d2 (patch) | |
tree | b4ad305e45bf2d66f5e3a8d35aa36948a2f20c5a /scene/3d/physics_body.h | |
parent | d454e64f429affb89de036eed6daa5c6e5278492 (diff) |
Port collision and layer masks to 3D, fixes #1759
Raycasts now have type_mask and layer_mask. Areas - collision_mask and layer_mask. PhysicsBodies needed only collision_mask.
Diffstat (limited to 'scene/3d/physics_body.h')
-rw-r--r-- | scene/3d/physics_body.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h index da79d63f00..f95b4f017f 100644 --- a/scene/3d/physics_body.h +++ b/scene/3d/physics_body.h @@ -39,6 +39,11 @@ class PhysicsBody : public CollisionObject { OBJ_TYPE(PhysicsBody,CollisionObject); uint32_t layer_mask; + uint32_t collision_mask; + + void _set_layers(uint32_t p_mask); + uint32_t _get_layers() const; + protected: static void _bind_methods(); @@ -53,6 +58,15 @@ public: void set_layer_mask(uint32_t p_mask); uint32_t get_layer_mask() const; + void set_collision_mask(uint32_t p_mask); + uint32_t get_collision_mask() const; + + void set_layer_mask_bit(int p_bit, bool p_value); + bool get_layer_mask_bit(int p_bit) const; + + void set_collision_mask_bit(int p_bit, bool p_value); + bool get_collision_mask_bit(int p_bit) const; + void add_collision_exception_with(Node* p_node); //must be physicsbody void remove_collision_exception_with(Node* p_node); |