1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Added physics API in order to enable/disable collisions between rigidbody attached to a joint with bullet physics bullet

Fixes #16424
This commit is contained in:
Andrea Catania
2018-02-05 18:20:26 +01:00
parent ea99b90a77
commit a42765dada
15 changed files with 121 additions and 13 deletions

View File

@@ -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);
}
}