re-organized memory (stack and pool) allocators. this lets the user pass in their own memory allocators.
This commit is contained in:
@@ -17,6 +17,9 @@ subject to the following restrictions:
|
||||
#define BT_COLLISION_CONFIGURATION
|
||||
struct btCollisionAlgorithmCreateFunc;
|
||||
|
||||
class btStackAlloc;
|
||||
class btPoolAllocator;
|
||||
|
||||
///btCollisionConfiguration allows to configure Bullet collision detection
|
||||
///stack allocator size, default collision algorithms and persistent manifold pool size
|
||||
///todo: describe the meaning
|
||||
@@ -29,14 +32,12 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
///pool size for the persistent contact manifold
|
||||
virtual int getPersistentManifoldPoolSize() = 0;
|
||||
///memory pools
|
||||
virtual btPoolAllocator* getPersistentManifoldPool() = 0;
|
||||
|
||||
virtual int getStackAllocatorSize() = 0;
|
||||
virtual btPoolAllocator* getCollisionAlgorithmPool() = 0;
|
||||
|
||||
virtual int getCollisionAlgorithmPoolSize() = 0;
|
||||
|
||||
virtual int getCollisionAlgorithmMaxElementSize() = 0;
|
||||
virtual btStackAlloc* getStackAllocator() = 0;
|
||||
|
||||
virtual btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1) =0;
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ btCollisionDispatcher::btCollisionDispatcher (btCollisionConfiguration* collisio
|
||||
|
||||
setNearCallback(defaultNearCallback);
|
||||
|
||||
m_collisionAlgorithmPoolAllocator = new btPoolAllocator(m_collisionConfiguration->getCollisionAlgorithmMaxElementSize(),m_collisionConfiguration->getCollisionAlgorithmPoolSize());
|
||||
m_collisionAlgorithmPoolAllocator = collisionConfiguration->getCollisionAlgorithmPool();
|
||||
|
||||
m_persistentManifoldPoolAllocator = new btPoolAllocator(sizeof(btPersistentManifold),m_collisionConfiguration->getPersistentManifoldPoolSize());
|
||||
m_persistentManifoldPoolAllocator = collisionConfiguration->getPersistentManifoldPool();
|
||||
|
||||
for (i=0;i<MAX_BROADPHASE_COLLISION_TYPES;i++)
|
||||
{
|
||||
@@ -65,8 +65,6 @@ void btCollisionDispatcher::registerCollisionCreateFunc(int proxyType0, int prox
|
||||
|
||||
btCollisionDispatcher::~btCollisionDispatcher()
|
||||
{
|
||||
delete m_collisionAlgorithmPoolAllocator;
|
||||
delete m_persistentManifoldPoolAllocator;
|
||||
}
|
||||
|
||||
btPersistentManifold* btCollisionDispatcher::getNewManifold(void* b0,void* b1)
|
||||
|
||||
@@ -124,6 +124,20 @@ public:
|
||||
|
||||
virtual void freeCollisionAlgorithm(void* ptr);
|
||||
|
||||
btCollisionConfiguration* getCollisionConfiguration()
|
||||
{
|
||||
return m_collisionConfiguration;
|
||||
}
|
||||
|
||||
const btCollisionConfiguration* getCollisionConfiguration() const
|
||||
{
|
||||
return m_collisionConfiguration;
|
||||
}
|
||||
|
||||
void setCollisionConfiguration(btCollisionConfiguration* config)
|
||||
{
|
||||
m_collisionConfiguration = config;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -35,24 +35,22 @@ subject to the following restrictions:
|
||||
//When the user doesn't provide dispatcher or broadphase, create basic versions (and delete them in destructor)
|
||||
#include "BulletCollision/CollisionDispatch/btCollisionDispatcher.h"
|
||||
#include "BulletCollision/BroadphaseCollision/btSimpleBroadphase.h"
|
||||
#include "BulletCollision/CollisionDispatch/btCollisionConfiguration.h"
|
||||
|
||||
|
||||
|
||||
btCollisionWorld::btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache, int stackSize)
|
||||
btCollisionWorld::btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache, btCollisionConfiguration* collisionConfiguration)
|
||||
:m_dispatcher1(dispatcher),
|
||||
m_broadphasePairCache(pairCache),
|
||||
m_ownsDispatcher(false),
|
||||
m_ownsBroadphasePairCache(false)
|
||||
{
|
||||
m_stackAlloc = new btStackAlloc(stackSize);
|
||||
m_stackAlloc = collisionConfiguration->getStackAllocator();
|
||||
m_dispatchInfo.m_stackAllocator = m_stackAlloc;
|
||||
}
|
||||
|
||||
|
||||
btCollisionWorld::~btCollisionWorld()
|
||||
{
|
||||
m_stackAlloc->destroy();
|
||||
delete m_stackAlloc;
|
||||
|
||||
//clean up remaining objects
|
||||
int i;
|
||||
|
||||
@@ -98,7 +98,7 @@ protected:
|
||||
public:
|
||||
|
||||
//this constructor doesn't own the dispatcher and paircache/broadphase
|
||||
btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphasePairCache, int stackSize = 2*1024*1024);
|
||||
btCollisionWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphasePairCache, btCollisionConfiguration* collisionConfiguration);
|
||||
|
||||
virtual ~btCollisionWorld();
|
||||
|
||||
|
||||
@@ -24,15 +24,16 @@ subject to the following restrictions:
|
||||
#include "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.h"
|
||||
#include "BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.h"
|
||||
|
||||
#include "LinearMath/btStackAlloc.h"
|
||||
#include "LinearMath/btPoolAllocator.h"
|
||||
|
||||
|
||||
|
||||
#define DEFAULT_MAX_OVERLAPPING_PAIRS 65535
|
||||
#define DEFAULT_STACK_ALLOCATOR_SIZE (5*1024*1024)
|
||||
|
||||
|
||||
btDefaultCollisionConfiguration::btDefaultCollisionConfiguration()
|
||||
:m_persistentManifoldPoolSize(DEFAULT_MAX_OVERLAPPING_PAIRS),
|
||||
m_stackAllocatorSize(DEFAULT_STACK_ALLOCATOR_SIZE),
|
||||
m_collisionAlgorithmPoolSize(DEFAULT_MAX_OVERLAPPING_PAIRS),
|
||||
m_collisionAlgorithmMaxElementSize(0)
|
||||
btDefaultCollisionConfiguration::btDefaultCollisionConfiguration(btStackAlloc* stackAlloc,btPoolAllocator* persistentManifoldPool,btPoolAllocator* collisionAlgorithmPool)
|
||||
{
|
||||
|
||||
//default CreationFunctions, filling the m_doubleDispatch table
|
||||
@@ -58,14 +59,62 @@ m_collisionAlgorithmMaxElementSize(0)
|
||||
int maxSize3 = sizeof(btCompoundCollisionAlgorithm);
|
||||
int maxSize4 = sizeof(btEmptyAlgorithm);
|
||||
|
||||
m_collisionAlgorithmMaxElementSize = btMax(maxSize,maxSize2);
|
||||
m_collisionAlgorithmMaxElementSize = btMax(m_collisionAlgorithmMaxElementSize,maxSize3);
|
||||
m_collisionAlgorithmMaxElementSize = btMax(m_collisionAlgorithmMaxElementSize,maxSize4);
|
||||
int collisionAlgorithmMaxElementSize = btMax(maxSize,maxSize2);
|
||||
collisionAlgorithmMaxElementSize = btMax(collisionAlgorithmMaxElementSize,maxSize3);
|
||||
collisionAlgorithmMaxElementSize = btMax(collisionAlgorithmMaxElementSize,maxSize4);
|
||||
|
||||
if (stackAlloc)
|
||||
{
|
||||
m_ownsStackAllocator = false;
|
||||
this->m_stackAlloc = stackAlloc;
|
||||
} else
|
||||
{
|
||||
m_ownsStackAllocator = true;
|
||||
void* mem = btAlignedAlloc(sizeof(btStackAlloc),16);
|
||||
m_stackAlloc = new(mem)btStackAlloc(DEFAULT_STACK_ALLOCATOR_SIZE);
|
||||
}
|
||||
|
||||
if (persistentManifoldPool)
|
||||
{
|
||||
m_ownsPersistentManifoldPool = false;
|
||||
m_persistentManifoldPool = persistentManifoldPool;
|
||||
} else
|
||||
{
|
||||
m_ownsPersistentManifoldPool = true;
|
||||
void* mem = btAlignedAlloc(sizeof(btPoolAllocator),16);
|
||||
m_persistentManifoldPool = new (mem) btPoolAllocator(sizeof(btPersistentManifold),DEFAULT_MAX_OVERLAPPING_PAIRS);
|
||||
}
|
||||
|
||||
if (collisionAlgorithmPool)
|
||||
{
|
||||
m_ownsCollisionAlgorithmPool = false;
|
||||
m_collisionAlgorithmPool = collisionAlgorithmPool;
|
||||
} else
|
||||
{
|
||||
m_ownsCollisionAlgorithmPool = true;
|
||||
void* mem = btAlignedAlloc(sizeof(btPoolAllocator),16);
|
||||
m_collisionAlgorithmPool = new(mem) btPoolAllocator(collisionAlgorithmMaxElementSize,DEFAULT_MAX_OVERLAPPING_PAIRS);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
btDefaultCollisionConfiguration::~btDefaultCollisionConfiguration()
|
||||
{
|
||||
if (m_ownsStackAllocator)
|
||||
{
|
||||
m_stackAlloc->destroy();
|
||||
btAlignedFree(m_stackAlloc);
|
||||
}
|
||||
if (m_ownsCollisionAlgorithmPool)
|
||||
{
|
||||
btAlignedFree(m_collisionAlgorithmPool);
|
||||
}
|
||||
if (m_ownsPersistentManifoldPool)
|
||||
{
|
||||
btAlignedFree(m_persistentManifoldPool);
|
||||
}
|
||||
|
||||
delete m_convexConvexCreateFunc;
|
||||
delete m_convexConcaveCreateFunc;
|
||||
delete m_swappedConvexConcaveCreateFunc;
|
||||
@@ -79,28 +128,6 @@ btDefaultCollisionConfiguration::~btDefaultCollisionConfiguration()
|
||||
delete m_triangleSphereCF;
|
||||
|
||||
|
||||
}
|
||||
|
||||
///pool size for the persistent contact manifold
|
||||
int btDefaultCollisionConfiguration::getPersistentManifoldPoolSize()
|
||||
{
|
||||
return m_persistentManifoldPoolSize;
|
||||
}
|
||||
|
||||
int btDefaultCollisionConfiguration::getStackAllocatorSize()
|
||||
{
|
||||
return m_stackAllocatorSize;
|
||||
}
|
||||
|
||||
int btDefaultCollisionConfiguration::getCollisionAlgorithmPoolSize()
|
||||
{
|
||||
return m_collisionAlgorithmPoolSize;
|
||||
}
|
||||
|
||||
int btDefaultCollisionConfiguration::getCollisionAlgorithmMaxElementSize()
|
||||
{
|
||||
return m_collisionAlgorithmMaxElementSize;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,19 +19,23 @@ subject to the following restrictions:
|
||||
#include "btCollisionConfiguration.h"
|
||||
|
||||
///btCollisionConfiguration allows to configure Bullet collision detection
|
||||
///stack allocator size, default collision algorithms and persistent manifold pool size
|
||||
///stack allocator, pool memory allocators
|
||||
///todo: describe the meaning
|
||||
class btDefaultCollisionConfiguration : public btCollisionConfiguration
|
||||
{
|
||||
|
||||
int m_persistentManifoldPoolSize;
|
||||
|
||||
int m_stackAllocatorSize;
|
||||
btStackAlloc* m_stackAlloc;
|
||||
bool m_ownsStackAllocator;
|
||||
|
||||
int m_collisionAlgorithmPoolSize;
|
||||
btPoolAllocator* m_persistentManifoldPool;
|
||||
bool m_ownsPersistentManifoldPool;
|
||||
|
||||
int m_collisionAlgorithmMaxElementSize;
|
||||
btPoolAllocator* m_collisionAlgorithmPool;
|
||||
bool m_ownsCollisionAlgorithmPool;
|
||||
|
||||
|
||||
//default CreationFunctions, filling the m_doubleDispatch table
|
||||
btCollisionAlgorithmCreateFunc* m_convexConvexCreateFunc;
|
||||
btCollisionAlgorithmCreateFunc* m_convexConcaveCreateFunc;
|
||||
@@ -47,35 +51,30 @@ class btDefaultCollisionConfiguration : public btCollisionConfiguration
|
||||
|
||||
public:
|
||||
|
||||
btDefaultCollisionConfiguration();
|
||||
btDefaultCollisionConfiguration(btStackAlloc* stackAlloc=0,btPoolAllocator* persistentManifoldPool=0,btPoolAllocator* collisionAlgorithmPool=0);
|
||||
|
||||
virtual ~btDefaultCollisionConfiguration();
|
||||
|
||||
///pool size for the persistent contact manifold
|
||||
virtual int getPersistentManifoldPoolSize();
|
||||
///memory pools
|
||||
virtual btPoolAllocator* getPersistentManifoldPool()
|
||||
{
|
||||
return m_persistentManifoldPool;
|
||||
}
|
||||
|
||||
virtual int getStackAllocatorSize();
|
||||
virtual btPoolAllocator* getCollisionAlgorithmPool()
|
||||
{
|
||||
return m_collisionAlgorithmPool;
|
||||
}
|
||||
|
||||
virtual int getCollisionAlgorithmPoolSize();
|
||||
virtual btStackAlloc* getStackAllocator()
|
||||
{
|
||||
return m_stackAlloc;
|
||||
}
|
||||
|
||||
virtual int getCollisionAlgorithmMaxElementSize();
|
||||
|
||||
btCollisionAlgorithmCreateFunc* getCollisionAlgorithmCreateFunc(int proxyType0,int proxyType1);
|
||||
|
||||
void setStackAllocatorSize(int size)
|
||||
{
|
||||
m_stackAllocatorSize = size;
|
||||
}
|
||||
|
||||
void setPersistentManifoldPoolSize(int size)
|
||||
{
|
||||
m_persistentManifoldPoolSize = size;
|
||||
}
|
||||
|
||||
void setCollisionAlgorithmPoolSize(int size)
|
||||
{
|
||||
m_collisionAlgorithmPoolSize = size;
|
||||
}
|
||||
};
|
||||
|
||||
#endif //BT_DEFAULT_COLLISION_CONFIGURATION
|
||||
|
||||
@@ -25,17 +25,17 @@ void btSimulationIslandManager::initUnionFind(int n)
|
||||
}
|
||||
|
||||
|
||||
void btSimulationIslandManager::findUnions(btDispatcher* dispatcher)
|
||||
void btSimulationIslandManager::findUnions(btDispatcher* dispatcher,btCollisionWorld* colWorld)
|
||||
{
|
||||
|
||||
{
|
||||
for (int i=0;i<dispatcher->getNumManifolds();i++)
|
||||
{
|
||||
const btPersistentManifold* manifold = dispatcher->getManifoldByIndexInternal(i);
|
||||
//static objects (invmass btScalar(0.)) don't merge !
|
||||
btBroadphasePair* pairPtr = colWorld->getPairCache()->getOverlappingPairArrayPtr();
|
||||
|
||||
const btCollisionObject* colObj0 = static_cast<const btCollisionObject*>(manifold->getBody0());
|
||||
const btCollisionObject* colObj1 = static_cast<const btCollisionObject*>(manifold->getBody1());
|
||||
for (int i=0;i<colWorld->getPairCache()->getNumOverlappingPairs();i++)
|
||||
{
|
||||
const btBroadphasePair& collisionPair = pairPtr[i];
|
||||
btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
|
||||
btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
|
||||
|
||||
if (((colObj0) && ((colObj0)->mergesSimulationIslands())) &&
|
||||
((colObj1) && ((colObj1)->mergesSimulationIslands())))
|
||||
@@ -71,7 +71,7 @@ void btSimulationIslandManager::updateActivationState(btCollisionWorld* colWorld
|
||||
}
|
||||
// do the union find
|
||||
|
||||
findUnions(dispatcher);
|
||||
findUnions(dispatcher,colWorld);
|
||||
|
||||
|
||||
|
||||
@@ -259,11 +259,11 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
|
||||
{
|
||||
|
||||
//kinematic objects don't merge islands, but wake up all connected objects
|
||||
if (colObj0->isStaticOrKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING)
|
||||
if (colObj0->isKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING)
|
||||
{
|
||||
colObj1->activate();
|
||||
}
|
||||
if (colObj1->isStaticOrKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING)
|
||||
if (colObj1->isKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING)
|
||||
{
|
||||
colObj0->activate();
|
||||
}
|
||||
@@ -300,6 +300,7 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
|
||||
|
||||
btAlignedObjectArray<btCollisionObject*> islandBodies;
|
||||
|
||||
// printf("Start Islands\n");
|
||||
|
||||
//traverse the simulation islands, and call the solver, unless all objects are sleeping/deactivated
|
||||
for ( startIslandIndex=0;startIslandIndex<numElem;startIslandIndex = endIslandIndex)
|
||||
@@ -343,6 +344,7 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
|
||||
if (!islandSleeping)
|
||||
{
|
||||
callback->ProcessIsland(&islandBodies[0],islandBodies.size(),startManifold,numIslandManifolds, islandId);
|
||||
// printf("Island callback of size:%d bodies, %d manifolds\n",islandBodies.size(),numIslandManifolds);
|
||||
}
|
||||
|
||||
if (numIslandManifolds)
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
virtual void storeIslandActivationState(btCollisionWorld* world);
|
||||
|
||||
|
||||
void findUnions(btDispatcher* dispatcher);
|
||||
void findUnions(btDispatcher* dispatcher,btCollisionWorld* colWorld);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -117,6 +117,7 @@ public:
|
||||
m_pointCache[index] = m_pointCache[lastUsedIndex];
|
||||
//get rid of duplicated userPersistentData pointer
|
||||
m_pointCache[lastUsedIndex].m_userPersistentData = 0;
|
||||
m_pointCache[lastUsedIndex].m_lifeTime = 0;
|
||||
}
|
||||
|
||||
btAssert(m_pointCache[lastUsedIndex].m_userPersistentData==0);
|
||||
|
||||
@@ -447,6 +447,7 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCol
|
||||
END_PROFILE("refreshManifolds");
|
||||
#endif //FORCE_REFESH_CONTACT_MANIFOLDS
|
||||
|
||||
btVector3 color(0,1,0);
|
||||
|
||||
|
||||
BEGIN_PROFILE("gatherSolverData");
|
||||
@@ -559,6 +560,9 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendlySetup(btCol
|
||||
{
|
||||
|
||||
btManifoldPoint& cp = manifold->getContactPoint(j);
|
||||
|
||||
if (debugDrawer)
|
||||
debugDrawer->drawContactPoint(cp.m_positionWorldOnB,cp.m_normalWorldOnB,cp.getDistance(),cp.getLifeTime(),color);
|
||||
|
||||
|
||||
if (cp.getDistance() <= btScalar(0.))
|
||||
@@ -938,6 +942,7 @@ btScalar btSequentialImpulseConstraintSolver::solveGroup(btCollisionObject** bod
|
||||
solveFriction((btRigidBody*)manifold->getBody0(),
|
||||
(btRigidBody*)manifold->getBody1(),manifold->getContactPoint(gOrder[j].m_pointIndex),info,iteration,debugDrawer);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ plDynamicsWorldHandle plCreateDynamicsWorld(plPhysicsSdkHandle physicsSdkHandle)
|
||||
btBroadphaseInterface* pairCache = new btAxisSweep3(physicsSdk->m_worldAabbMin,physicsSdk->m_worldAabbMax);
|
||||
btConstraintSolver* constraintSolver = new btSequentialImpulseConstraintSolver();
|
||||
|
||||
return (plDynamicsWorldHandle) new btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver);
|
||||
return (plDynamicsWorldHandle) new btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration);
|
||||
}
|
||||
void plDeleteDynamicsWorld(plDynamicsWorldHandle world)
|
||||
{
|
||||
|
||||
@@ -33,8 +33,8 @@ subject to the following restrictions:
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
btContinuousDynamicsWorld::btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver)
|
||||
:btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver)
|
||||
btContinuousDynamicsWorld::btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration)
|
||||
:btDiscreteDynamicsWorld(dispatcher,pairCache,constraintSolver,collisionConfiguration)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class btContinuousDynamicsWorld : public btDiscreteDynamicsWorld
|
||||
|
||||
public:
|
||||
|
||||
btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver);
|
||||
btContinuousDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
|
||||
virtual ~btContinuousDynamicsWorld();
|
||||
|
||||
///time stepping with calculation of time of impact for selected fast moving objects
|
||||
|
||||
@@ -57,8 +57,8 @@ subject to the following restrictions:
|
||||
|
||||
|
||||
|
||||
btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver)
|
||||
:btDynamicsWorld(dispatcher,pairCache),
|
||||
btDiscreteDynamicsWorld::btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver, btCollisionConfiguration* collisionConfiguration)
|
||||
:btDynamicsWorld(dispatcher,pairCache,collisionConfiguration),
|
||||
m_constraintSolver(constraintSolver? constraintSolver: new btSequentialImpulseConstraintSolver),
|
||||
m_debugDrawer(0),
|
||||
m_gravity(0,-10,0),
|
||||
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
|
||||
|
||||
///this btDiscreteDynamicsWorld constructor gets created objects from the user, and will not delete those
|
||||
btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver);
|
||||
btDiscreteDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
|
||||
|
||||
virtual ~btDiscreteDynamicsWorld();
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ class btDynamicsWorld : public btCollisionWorld
|
||||
public:
|
||||
|
||||
|
||||
btDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphase)
|
||||
:btCollisionWorld(dispatcher,broadphase)
|
||||
btDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* broadphase,btCollisionConfiguration* collisionConfiguration)
|
||||
:btCollisionWorld(dispatcher,broadphase,collisionConfiguration)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ extern "C" void btBulletDynamicsProbe () {}
|
||||
|
||||
|
||||
|
||||
btSimpleDynamicsWorld::btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver)
|
||||
:btDynamicsWorld(dispatcher,pairCache),
|
||||
btSimpleDynamicsWorld::btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration)
|
||||
:btDynamicsWorld(dispatcher,pairCache,collisionConfiguration),
|
||||
m_constraintSolver(constraintSolver),
|
||||
m_ownsConstraintSolver(false),
|
||||
m_debugDrawer(0),
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
|
||||
///this btSimpleDynamicsWorld constructor creates dispatcher, broadphase pairCache and constraintSolver
|
||||
btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver);
|
||||
btSimpleDynamicsWorld(btDispatcher* dispatcher,btBroadphaseInterface* pairCache,btConstraintSolver* constraintSolver,btCollisionConfiguration* collisionConfiguration);
|
||||
|
||||
virtual ~btSimpleDynamicsWorld();
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ class btIDebugDraw
|
||||
|
||||
virtual void reportErrorWarning(const char* warningString) = 0;
|
||||
|
||||
virtual void draw3dText(const btVector3& location,const char* textString) = 0;
|
||||
|
||||
virtual void setDebugMode(int debugMode) =0;
|
||||
|
||||
virtual int getDebugMode() const = 0;
|
||||
|
||||
Reference in New Issue
Block a user