From a84962581350d91e15ad697c10dad11a66f4f975 Mon Sep 17 00:00:00 2001 From: ShyRed Date: Sat, 6 Apr 2019 17:11:36 +0200 Subject: [PATCH] Fix missing re-activation of bullet physics sleep feature Adds the missing option of re-enabling the sleep feature in bullet physics once a body had the sleep feature disabled. (cherry picked from commit 0877cf64192c60e2c7a47250a8a44a4d70d8ff54) --- modules/bullet/rigid_body_bullet.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/bullet/rigid_body_bullet.cpp b/modules/bullet/rigid_body_bullet.cpp index 22f22148981..e5f70a0b340 100644 --- a/modules/bullet/rigid_body_bullet.cpp +++ b/modules/bullet/rigid_body_bullet.cpp @@ -597,6 +597,8 @@ void RigidBodyBullet::set_state(PhysicsServer::BodyState p_state, const Variant if (!can_sleep) { // Can't sleep btBody->forceActivationState(DISABLE_DEACTIVATION); + } else { + btBody->forceActivationState(ACTIVE_TAG); } break; }