i would like to show how i configure/run the simulation. I have
changed this part of code many times.
I look at btDiscreteDynamicsWorld::stepSimulation:
Code: Select all
int btDiscreteDynamicsWorld::stepSimulation( btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep)
{
<...>
int numSimulationSubSteps = 0;
if (maxSubSteps)
{
//fixed timestep with interpolation
m_localTime += timeStep;
if (m_localTime >= fixedTimeStep)
{
numSimulationSubSteps = int( m_localTime / fixedTimeStep);
m_localTime -= numSimulationSubSteps * fixedTimeStep;
}
} else
{
//variable timestep
fixedTimeStep = timeStep;
m_localTime = timeStep;
if (btFuzzyZero(timeStep))
{
numSimulationSubSteps = 0;
maxSubSteps = 0;
} else
{
numSimulationSubSteps = 1;
maxSubSteps = 1;
}
}
<...>
}
Here is my code :
Edited. S. next post
Apps are here:
http://code.google.com/p/game-ws
One (small) problem i have is - if i use softbodies and set substeps = 0 (variable simulation rate) - softbodies are exploding and fps goes to 1-2 frames/s. The same application without softbodies is running O.K.
This stuff is configurable : hit ESCAPE to get Menu (once, it works currently on "key up" ), then "Options"->"Physics"
Due to problems with softbodies i have hidden the option in "lamp" test... It is available
only for "vehicle" test.
Any feedback is appreciated, thanks...