浏览代码

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.
ShyRed 6 年之前
父节点
当前提交
0877cf6419
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      modules/bullet/rigid_body_bullet.cpp

+ 2 - 0
modules/bullet/rigid_body_bullet.cpp

@@ -597,6 +597,8 @@ void RigidBodyBullet::set_state(PhysicsServer::BodyState p_state, const Variant
 			if (!can_sleep) {
 			if (!can_sleep) {
 				// Can't sleep
 				// Can't sleep
 				btBody->forceActivationState(DISABLE_DEACTIVATION);
 				btBody->forceActivationState(DISABLE_DEACTIVATION);
+			} else {
+				btBody->forceActivationState(ACTIVE_TAG);
 			}
 			}
 			break;
 			break;
 	}
 	}