From 41ad5d3c06ea8cb066c2c80b87df8b1d3e4066d3 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Sat, 17 Jul 2010 01:06:38 +0000 Subject: [PATCH] revert accidentally committed testing code for the btParallelConstraintSolver (in BasicDemo) --- Demos/BasicDemo/BasicDemo.cpp | 50 ++-------------------------------- Demos/BasicDemo/CMakeLists.txt | 3 +- 2 files changed, 4 insertions(+), 49 deletions(-) diff --git a/Demos/BasicDemo/BasicDemo.cpp b/Demos/BasicDemo/BasicDemo.cpp index 50566d13c..e945074e1 100644 --- a/Demos/BasicDemo/BasicDemo.cpp +++ b/Demos/BasicDemo/BasicDemo.cpp @@ -33,11 +33,6 @@ subject to the following restrictions: #include "GlutStuff.h" ///btBulletDynamicsCommon.h is the main Bullet include file, contains most common include files. #include "btBulletDynamicsCommon.h" - -#include "BulletMultiThreaded/Win32ThreadSupport.h" -#include "BulletMultiThreaded/btParallelConstraintSolver.h" -#include "BulletCollision/CollisionDispatch/btSimulationIslandManager.h" - #ifdef TEST_SERIALIZATION #include "LinearMath/btSerializer.h" #endif //TEST_SERIALIZATION @@ -55,7 +50,7 @@ void BasicDemo::clientMoveAndDisplay() ///step the simulation if (m_dynamicsWorld) { - m_dynamicsWorld->stepSimulation(1./60.,0);//ms / 1000000.f,0); + m_dynamicsWorld->stepSimulation(ms / 1000000.f); //optional but useful: debug drawing m_dynamicsWorld->debugDrawWorld(); } @@ -84,35 +79,7 @@ void BasicDemo::displayCallback(void) { 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(); ///the default constraint solver. For parallel processing you can use a different solver (see Extras/BulletMultiThreaded) - //btSequentialImpulseConstraintSolver* sol = new btSequentialImpulseConstraintSolver; - - //btSequentialImpulseConstraintSolver* sol = new btSequentialImpulseConstraintSolver; - btParallelConstraintSolver* sol = new btParallelConstraintSolver(createSolverThreadSupport(4)); - - - - + btSequentialImpulseConstraintSolver* sol = new btSequentialImpulseConstraintSolver; m_solver = sol; - btDiscreteDynamicsWorld* world = new btDiscreteDynamicsWorld(m_dispatcher,m_broadphase,m_solver,m_collisionConfiguration); - - m_dynamicsWorld = world; - world->getSimulationIslandManager()->setSplitIslands(false); - + m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_broadphase,m_solver,m_collisionConfiguration); m_dynamicsWorld->setGravity(btVector3(0,-10,0)); diff --git a/Demos/BasicDemo/CMakeLists.txt b/Demos/BasicDemo/CMakeLists.txt index d00423382..09568037b 100644 --- a/Demos/BasicDemo/CMakeLists.txt +++ b/Demos/BasicDemo/CMakeLists.txt @@ -13,14 +13,13 @@ SET(GLUT_ROOT ${BULLET_PHYSICS_SOURCE_DIR}/Glut) INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL -${VECTOR_MATH_INCLUDE} ) IF (USE_GLUT) 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)