소스 검색

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) {
 				// Can't sleep
 				btBody->forceActivationState(DISABLE_DEACTIVATION);
+			} else {
+				btBody->forceActivationState(ACTIVE_TAG);
 			}
 			break;
 	}