diff options
author | Andrea Catania <info@andreacatania.com> | 2018-02-05 18:20:26 +0100 |
---|---|---|
committer | Andrea Catania <info@andreacatania.com> | 2018-02-05 18:54:07 +0100 |
commit | a42765dadad77d4f4893d9ccf73b7cfefc1643bd (patch) | |
tree | 614566c3ecf4fa949417e158b82cbc6d97c03dd0 /servers/physics_2d/constraint_2d_sw.h | |
parent | ea99b90a77228189d6dc38ab7b7ada967d668ed8 (diff) | |
download | redot-engine-a42765dadad77d4f4893d9ccf73b7cfefc1643bd.tar.gz |
Added physics API in order to enable/disable collisions between rigidbody attached to a joint with bullet physics bullet
Fixes #16424
Diffstat (limited to 'servers/physics_2d/constraint_2d_sw.h')
-rw-r--r-- | servers/physics_2d/constraint_2d_sw.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/servers/physics_2d/constraint_2d_sw.h b/servers/physics_2d/constraint_2d_sw.h index a08037bb37..c1954935d3 100644 --- a/servers/physics_2d/constraint_2d_sw.h +++ b/servers/physics_2d/constraint_2d_sw.h @@ -40,6 +40,7 @@ class Constraint2DSW : public RID_Data { uint64_t island_step; Constraint2DSW *island_next; Constraint2DSW *island_list_next; + bool disabled_collisions_between_bodies; RID self; @@ -48,6 +49,7 @@ protected: _body_ptr = p_body_ptr; _body_count = p_body_count; island_step = 0; + disabled_collisions_between_bodies = true; } public: @@ -66,6 +68,9 @@ public: _FORCE_INLINE_ Body2DSW **get_body_ptr() const { return _body_ptr; } _FORCE_INLINE_ int get_body_count() const { return _body_count; } + _FORCE_INLINE_ void disable_collisions_between_bodies(const bool p_disabled) { disabled_collisions_between_bodies = p_disabled; } + _FORCE_INLINE_ bool is_disabled_collisions_between_bodies() const { return disabled_collisions_between_bodies; } + virtual bool setup(real_t p_step) = 0; virtual void solve(real_t p_step) = 0; |