two minor changes, hopefully before release:
authorErwin Coumans <blender@erwincoumans.com>
Mon, 7 May 2007 17:10:44 +0000 (17:10 +0000)
committerErwin Coumans <blender@erwincoumans.com>
Mon, 7 May 2007 17:10:44 +0000 (17:10 +0000)
- reset randseed, which should make simulations more predictable
- re-activate substeps (for more accurate simulations)

extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp

index 94eece73e7c4afbceae393bc76ec24c259fd648e..eaf172b93951757afdcee509c682868b621c879f 100644 (file)
@@ -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
index 348941286903e7a10187daf20e0f6acbef002e45..bc69fe85effbc6d5572814ac659d38a81ca28c58 100644 (file)
@@ -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++)
        {