Bullet plugin update for bullet 2.85.

Fix potential crash with BtPlayer::_stepForward
This commit is contained in:
rextimmy 2016-12-28 18:33:19 +10:00
parent 540c9b72c0
commit c08f75f52a
4 changed files with 6 additions and 47 deletions

View file

@ -33,11 +33,6 @@
#include "console/consoleTypes.h"
#include "scene/sceneRenderState.h"
#include "T3D/gameBase/gameProcess.h"
#ifdef _WIN32
#include "BulletMultiThreaded/Win32ThreadSupport.h"
#elif defined (USE_PTHREADS)
#include "BulletMultiThreaded/PosixThreadSupport.h"
#endif
BtWorld::BtWorld() :
mProcessList( NULL ),
@ -46,8 +41,7 @@ BtWorld::BtWorld() :
mTickCount( 0 ),
mIsEnabled( false ),
mEditorTimeScale( 1.0f ),
mDynamicsWorld( NULL ),
mThreadSupportCollision( NULL )
mDynamicsWorld( NULL )
{
}
@ -59,33 +53,7 @@ bool BtWorld::initWorld( bool isServer, ProcessList *processList )
{
// Collision configuration contains default setup for memory, collision setup.
mCollisionConfiguration = new btDefaultCollisionConfiguration();
// TODO: There is something wrong with multithreading
// and compound convex shapes... so disable it for now.
static const U32 smMaxThreads = 1;
// Different initialization with threading enabled.
if ( smMaxThreads > 1 )
{
// TODO: ifdef assumes smMaxThread is always one at this point. MACOSX support to be decided
#ifdef WIN32
mThreadSupportCollision = new Win32ThreadSupport(
Win32ThreadSupport::Win32ThreadConstructionInfo( isServer ? "bt_servercol" : "bt_clientcol",
processCollisionTask,
createCollisionLocalStoreMemory,
smMaxThreads ) );
mDispatcher = new SpuGatheringCollisionDispatcher( mThreadSupportCollision,
smMaxThreads,
mCollisionConfiguration );
#endif // WIN32
}
else
{
mThreadSupportCollision = NULL;
mDispatcher = new btCollisionDispatcher( mCollisionConfiguration );
}
mDispatcher = new btCollisionDispatcher( mCollisionConfiguration );
btVector3 worldMin( -2000, -2000, -1000 );
btVector3 worldMax( 2000, 2000, 1000 );
@ -134,7 +102,6 @@ void BtWorld::_destroy()
SAFE_DELETE( mSolver );
SAFE_DELETE( mBroadphase );
SAFE_DELETE( mDispatcher );
SAFE_DELETE( mThreadSupportCollision );
SAFE_DELETE( mCollisionConfiguration );
}
@ -144,12 +111,12 @@ void BtWorld::tickPhysics( U32 elapsedMs )
return;
// Did we forget to call getPhysicsResults somewhere?
AssertFatal( !mIsSimulating, "PhysXWorld::tickPhysics() - Already simulating!" );
AssertFatal( !mIsSimulating, "BtWorld::tickPhysics() - Already simulating!" );
// The elapsed time should be non-zero and
// a multiple of TickMs!
AssertFatal( elapsedMs != 0 &&
( elapsedMs % TickMs ) == 0 , "PhysXWorld::tickPhysics() - Got bad elapsed time!" );
( elapsedMs % TickMs ) == 0 , "BtWorld::tickPhysics() - Got bad elapsed time!" );
PROFILE_SCOPE(BtWorld_TickPhysics);