diff options
-rw-r--r-- | extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp | 3 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp index 94eece73e7c..eaf172b9395 100644 --- a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp +++ b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp @@ -104,6 +104,7 @@ bool MyContactDestroyedCallback(void* userPersistentData) btSequentialImpulseConstraintSolver3::btSequentialImpulseConstraintSolver3() { + btSeed2 = 0; setSolverMode(SOLVER_RANDMIZE_ORDER); } @@ -111,6 +112,8 @@ btSequentialImpulseConstraintSolver3::btSequentialImpulseConstraintSolver3() btSequentialImpulseConstraintSolver::btSequentialImpulseConstraintSolver() :m_solverMode(SOLVER_USE_WARMSTARTING) { + btSeed2 = 0; + gContactDestroyedCallback = &MyContactDestroyedCallback; //initialize default friction/contact funcs diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index 34894128690..bc69fe85eff 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -458,8 +458,12 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep) ctrl->SynchronizeMotionStates(timeStep); } - m_dynamicsWorld->stepSimulation(timeStep,0);//perform always a full simulation step - + float subStep = timeStep / float(m_numTimeSubSteps); + for (i=0;i<m_numTimeSubSteps;i++) + { + m_dynamicsWorld->stepSimulation(subStep,0);//perform always a full simulation step + } + numCtrl = GetNumControllers(); for (i=0;i<numCtrl;i++) { |