From 46649e6b7decd05b009a63c123ae5cd8b28c363a Mon Sep 17 00:00:00 2001 From: Benau Date: Wed, 5 Aug 2020 12:10:17 +0800 Subject: [PATCH] Fix always self-moving object in offline game --- lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp | 5 ++--- lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.h | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp b/lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp index ddabefac0..88a6a50dd 100644 --- a/lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp +++ b/lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.cpp @@ -22,8 +22,7 @@ subject to the following restrictions: #include "LinearMath/btSerializer.h" //'temporarily' global variables -// Need to disable completely for STK with multiple physics instance -//btScalar gDeactivationTime = btScalar(2.); +btScalar gDeactivationTime = btScalar(2.); //bool gDisableDeactivation = false; //static int uniqueId = 0; @@ -82,7 +81,7 @@ void btRigidBody::setupRigidBody(const btRigidBody::btRigidBodyConstructionInfo& m_restitution = constructionInfo.m_restitution; setCollisionShape( constructionInfo.m_collisionShape ); -// m_debugBodyId = uniqueId++; + //m_debugBodyId = uniqueId++; btAssert(constructionInfo.m_mass>=0); setMassProps(constructionInfo.m_mass, constructionInfo.m_localInertia); updateInertiaTensor(); diff --git a/lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.h b/lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.h index 445e4d813..0febf0cdb 100644 --- a/lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.h +++ b/lib/bullet/src/BulletDynamics/Dynamics/btRigidBody.h @@ -470,10 +470,10 @@ public: if ( (getActivationState() == ISLAND_SLEEPING) || (getActivationState() == WANTS_DEACTIVATION)) return true; - //if (m_deactivationTime> gDeactivationTime) - //{ - // return true; - //} + if (m_deactivationTime> gDeactivationTime) + { + return true; + } return false; }