revert accidentally committed testing code for the btParallelConstraintSolver (in BasicDemo)
This commit is contained in:
@@ -33,11 +33,6 @@ subject to the following restrictions:
|
|||||||
#include "GlutStuff.h"
|
#include "GlutStuff.h"
|
||||||
///btBulletDynamicsCommon.h is the main Bullet include file, contains most common include files.
|
///btBulletDynamicsCommon.h is the main Bullet include file, contains most common include files.
|
||||||
#include "btBulletDynamicsCommon.h"
|
#include "btBulletDynamicsCommon.h"
|
||||||
|
|
||||||
#include "BulletMultiThreaded/Win32ThreadSupport.h"
|
|
||||||
#include "BulletMultiThreaded/btParallelConstraintSolver.h"
|
|
||||||
#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h"
|
|
||||||
|
|
||||||
#ifdef TEST_SERIALIZATION
|
#ifdef TEST_SERIALIZATION
|
||||||
#include "LinearMath/btSerializer.h"
|
#include "LinearMath/btSerializer.h"
|
||||||
#endif //TEST_SERIALIZATION
|
#endif //TEST_SERIALIZATION
|
||||||
@@ -55,7 +50,7 @@ void BasicDemo::clientMoveAndDisplay()
|
|||||||
///step the simulation
|
///step the simulation
|
||||||
if (m_dynamicsWorld)
|
if (m_dynamicsWorld)
|
||||||
{
|
{
|
||||||
m_dynamicsWorld->stepSimulation(1./60.,0);//ms / 1000000.f,0);
|
m_dynamicsWorld->stepSimulation(ms / 1000000.f);
|
||||||
//optional but useful: debug drawing
|
//optional but useful: debug drawing
|
||||||
m_dynamicsWorld->debugDrawWorld();
|
m_dynamicsWorld->debugDrawWorld();
|
||||||
}
|
}
|
||||||
@@ -84,35 +79,7 @@ void BasicDemo::displayCallback(void) {
|
|||||||
swapBuffers();
|
swapBuffers();
|
||||||
}
|
}
|
||||||
|
|
||||||
btThreadSupportInterface* createSolverThreadSupport(int maxNumThreads)
|
|
||||||
{
|
|
||||||
//#define SEQUENTIAL
|
|
||||||
#ifdef SEQUENTIAL
|
|
||||||
SequentialThreadSupport::SequentialThreadConstructionInfo tci("solverThreads",SolverThreadFunc,SolverlsMemoryFunc);
|
|
||||||
SequentialThreadSupport* threadSupport = new SequentialThreadSupport(tci);
|
|
||||||
threadSupport->startSPU();
|
|
||||||
#else
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
Win32ThreadSupport::Win32ThreadConstructionInfo threadConstructionInfo("solverThreads",SolverThreadFunc,SolverlsMemoryFunc,maxNumThreads);
|
|
||||||
Win32ThreadSupport* threadSupport = new Win32ThreadSupport(threadConstructionInfo);
|
|
||||||
threadSupport->startSPU();
|
|
||||||
#elif defined (USE_PTHREADS)
|
|
||||||
PosixThreadSupport::ThreadConstructionInfo solverConstructionInfo("solver", SolverThreadFunc,
|
|
||||||
SolverlsMemoryFunc, maxNumThreads);
|
|
||||||
|
|
||||||
PosixThreadSupport* threadSupport = new PosixThreadSupport(solverConstructionInfo);
|
|
||||||
|
|
||||||
#else
|
|
||||||
SequentialThreadSupport::SequentialThreadConstructionInfo tci("solverThreads",SolverThreadFunc,SolverlsMemoryFunc);
|
|
||||||
SequentialThreadSupport* threadSupport = new SequentialThreadSupport(tci);
|
|
||||||
threadSupport->startSPU();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return threadSupport;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -133,21 +100,10 @@ void BasicDemo::initPhysics()
|
|||||||
m_broadphase = new btDbvtBroadphase();
|
m_broadphase = new btDbvtBroadphase();
|
||||||
|
|
||||||
///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
|
///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded)
|
||||||
//btSequentialImpulseConstraintSolver* sol = new btSequentialImpulseConstraintSolver;
|
btSequentialImpulseConstraintSolver* sol = new btSequentialImpulseConstraintSolver;
|
||||||
|
|
||||||
//btSequentialImpulseConstraintSolver* sol = new btSequentialImpulseConstraintSolver;
|
|
||||||
btParallelConstraintSolver* sol = new btParallelConstraintSolver(createSolverThreadSupport(4));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_solver = sol;
|
m_solver = sol;
|
||||||
|
|
||||||
btDiscreteDynamicsWorld* world = new btDiscreteDynamicsWorld(m_dispatcher,m_broadphase,m_solver,m_collisionConfiguration);
|
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_broadphase,m_solver,m_collisionConfiguration);
|
||||||
|
|
||||||
m_dynamicsWorld = world;
|
|
||||||
world->getSimulationIslandManager()->setSplitIslands(false);
|
|
||||||
|
|
||||||
|
|
||||||
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
|
m_dynamicsWorld->setGravity(btVector3(0,-10,0));
|
||||||
|
|
||||||
|
|||||||
@@ -13,14 +13,13 @@ SET(GLUT_ROOT ${BULLET_PHYSICS_SOURCE_DIR}/Glut)
|
|||||||
|
|
||||||
INCLUDE_DIRECTORIES(
|
INCLUDE_DIRECTORIES(
|
||||||
${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL
|
${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL
|
||||||
${VECTOR_MATH_INCLUDE}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IF (USE_GLUT)
|
IF (USE_GLUT)
|
||||||
LINK_LIBRARIES(
|
LINK_LIBRARIES(
|
||||||
OpenGLSupport BulletMultiThreaded BulletDynamics BulletCollision LinearMath ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
|
OpenGLSupport BulletDynamics BulletCollision LinearMath ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
|
|||||||
Reference in New Issue
Block a user