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
This commit is contained in:
Rémi Verschelde
2018-02-13 15:26:04 +01:00
committed by GitHub
15 changed files with 121 additions and 13 deletions

View File

@@ -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) {

View File

@@ -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) {