Browse Source

If a rigid body is kinematic, set it to never deactivate itself.

Lasse Öörni 12 years ago
parent
commit
9d0eb0ffae
2 changed files with 3 additions and 2 deletions
  1. 2 1
      Source/Engine/Physics/RigidBody.cpp
  2. 1 1
      Source/ThirdParty/SDL/CMakeLists.txt

+ 2 - 1
Source/Engine/Physics/RigidBody.cpp

@@ -955,7 +955,8 @@ void RigidBody::AddBodyToWorld()
     else
     else
         flags &= ~btCollisionObject::CF_KINEMATIC_OBJECT;
         flags &= ~btCollisionObject::CF_KINEMATIC_OBJECT;
     body_->setCollisionFlags(flags);
     body_->setCollisionFlags(flags);
-
+    body_->forceActivationState(kinematic_ ? DISABLE_DEACTIVATION : ISLAND_SLEEPING);
+    
     if (!IsEnabledEffective())
     if (!IsEnabledEffective())
         return;
         return;
 
 

+ 1 - 1
Source/ThirdParty/SDL/CMakeLists.txt

@@ -9,12 +9,12 @@ file (GLOB C_FILES
 )
 )
 
 
 if (WIN32)
 if (WIN32)
-    CHECK_INCLUDE_FILES (wbemcli.h HAVE_WBEMCLI_H)
     # New MinGW versions may evaluate whether to use A or W postfix on functions before SDL gets to define UNICODE on its own,
     # New MinGW versions may evaluate whether to use A or W postfix on functions before SDL gets to define UNICODE on its own,
     # so make sure it is already defined
     # so make sure it is already defined
     if (MINGW)
     if (MINGW)
         add_definitions (-DUNICODE=1)
         add_definitions (-DUNICODE=1)
     endif ()
     endif ()
+    CHECK_INCLUDE_FILES (wbemcli.h HAVE_WBEMCLI_H)
     if (HAVE_WBEMCLI_H)
     if (HAVE_WBEMCLI_H)
         add_definitions (-DSDL_JOYSTICK_DINPUT)
         add_definitions (-DSDL_JOYSTICK_DINPUT)
         add_definitions (-DSDL_HAPTIC_DINPUT)
         add_definitions (-DSDL_HAPTIC_DINPUT)