summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-04-12 08:33:47 +0200
committerGitHub <noreply@github.com>2018-04-12 08:33:47 +0200
commit5324bbb77227f80d43604c8e104419f2700d8796 (patch)
tree93474cdc22bb408c44f61614d88eb92ad2a1a2ed
parent04a4e96bf5de4bdbb78a5a016335f09ff9efd100 (diff)
parentf0abdf06ad6dfc2ff4d403ff237281a4d5db46a6 (diff)
Merge pull request #18138 from AndreaCatania/patch-1
Rigidbody wake up when hitten by a kinematic body
-rw-r--r--modules/bullet/space_bullet.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/bullet/space_bullet.cpp b/modules/bullet/space_bullet.cpp
index 51a76ff8c5..9a88b4692b 100644
--- a/modules/bullet/space_bullet.cpp
+++ b/modules/bullet/space_bullet.cpp
@@ -1031,7 +1031,10 @@ bool SpaceBullet::recover_from_penetration(RigidBodyBullet *p_body, const btTran
for (int i = recover_broad_result.result_collision_objects.size() - 1; 0 <= i; --i) {
btCollisionObject *otherObject = recover_broad_result.result_collision_objects[i];
- if (!p_body->get_bt_collision_object()->checkCollideWith(otherObject) || !otherObject->checkCollideWith(p_body->get_bt_collision_object()) || (p_infinite_inertia && !otherObject->isStaticOrKinematicObject()))
+ if (p_infinite_inertia && !otherObject->isStaticOrKinematicObject()) {
+ otherObject->activate(); // Force activation of hitten rigid, soft body
+ continue;
+ } else if (!p_body->get_bt_collision_object()->checkCollideWith(otherObject) || !otherObject->checkCollideWith(p_body->get_bt_collision_object()))
continue;
if (otherObject->getCollisionShape()->isCompound()) {