diff options
| author | Andrea Catania | 2018-02-05 18:20:26 +0100 |
|---|---|---|
| committer | Andrea Catania | 2018-02-05 18:54:07 +0100 |
| commit | a42765dadad77d4f4893d9ccf73b7cfefc1643bd (patch) | |
| tree | 614566c3ecf4fa949417e158b82cbc6d97c03dd0 /modules/bullet/constraint_bullet.cpp | |
| parent | ea99b90a77228189d6dc38ab7b7ada967d668ed8 (diff) | |
| download | godot-a42765dadad77d4f4893d9ccf73b7cfefc1643bd.tar.gz godot-a42765dadad77d4f4893d9ccf73b7cfefc1643bd.tar.zst godot-a42765dadad77d4f4893d9ccf73b7cfefc1643bd.zip | |
Diffstat (limited to 'modules/bullet/constraint_bullet.cpp')
| -rw-r--r-- | modules/bullet/constraint_bullet.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/bullet/constraint_bullet.cpp b/modules/bullet/constraint_bullet.cpp index b60e89b6f..d15fb8de0 100644 --- a/modules/bullet/constraint_bullet.cpp +++ b/modules/bullet/constraint_bullet.cpp @@ -39,7 +39,8 @@ ConstraintBullet::ConstraintBullet() : space(NULL), - constraint(NULL) {} + constraint(NULL), + disabled_collisions_between_bodies(true) {} void ConstraintBullet::setup(btTypedConstraint *p_constraint) { constraint = p_constraint; @@ -53,3 +54,12 @@ void ConstraintBullet::set_space(SpaceBullet *p_space) { void ConstraintBullet::destroy_internal_constraint() { space->remove_constraint(this); } + +void ConstraintBullet::disable_collisions_between_bodies(const bool p_disabled) { + disabled_collisions_between_bodies = p_disabled; + + if (space) { + space->remove_constraint(this); + space->add_constraint(this, disabled_collisions_between_bodies); + } +} |
