diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2018-02-13 15:26:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-13 15:26:04 +0100 |
| commit | eefb58a892dfd5f334cbc86522a1cf0763af77d3 (patch) | |
| tree | 26451b667bdfe48006d98e1502a11738875c63b0 /scene | |
| parent | fd871b4d4f0b4441681a3f0c351058be5834b9dc (diff) | |
| parent | a42765dadad77d4f4893d9ccf73b7cfefc1643bd (diff) | |
| download | redot-engine-eefb58a892dfd5f334cbc86522a1cf0763af77d3.tar.gz | |
Merge pull request #16424 from AndreaCatania/phyj
Added physics API in order to enable/disable collisions between rigidbody attached to a joint with bullet physics bullet
Diffstat (limited to 'scene')
| -rw-r--r-- | scene/2d/joints_2d.cpp | 3 | ||||
| -rw-r--r-- | scene/3d/physics_joint.cpp | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/scene/2d/joints_2d.cpp b/scene/2d/joints_2d.cpp index 7a96a54854..329382c034 100644 --- a/scene/2d/joints_2d.cpp +++ b/scene/2d/joints_2d.cpp @@ -75,8 +75,7 @@ void Joint2D::_update_joint(bool p_only_free) { ba = body_a->get_rid(); bb = body_b->get_rid(); - if (exclude_from_collision) - Physics2DServer::get_singleton()->body_add_collision_exception(body_a->get_rid(), body_b->get_rid()); + Physics2DServer::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision); } void Joint2D::set_node_a(const NodePath &p_node_a) { diff --git a/scene/3d/physics_joint.cpp b/scene/3d/physics_joint.cpp index fed6d76f65..2e9f1a241a 100644 --- a/scene/3d/physics_joint.cpp +++ b/scene/3d/physics_joint.cpp @@ -71,8 +71,7 @@ void Joint::_update_joint(bool p_only_free) { ba = body_a->get_rid(); bb = body_b->get_rid(); - if (exclude_from_collision) - PhysicsServer::get_singleton()->body_add_collision_exception(body_a->get_rid(), body_b->get_rid()); + PhysicsServer::get_singleton()->joint_disable_collisions_between_bodies(joint, exclude_from_collision); } void Joint::set_node_a(const NodePath &p_node_a) { |
