Fix always self-moving object in offline game

This commit is contained in:
Benau 2020-08-05 12:10:17 +08:00
parent 2e12eeaa83
commit 46649e6b7d
2 changed files with 6 additions and 7 deletions

View File

@ -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();

View File

@ -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;
}