two minor changes, hopefully before release:

- reset randseed, which should make simulations more predictable
- re-activate substeps (for more accurate simulations)
This commit is contained in:
Erwin Coumans
2007-05-07 17:10:44 +00:00
parent f638895aad
commit d814e2b9c6
2 changed files with 9 additions and 2 deletions

View 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

View 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++)
{