You've already forked godot
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user