mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
replace tabs with spaces for indentation
This commit is contained in:
parent
2089a8c2dd
commit
568050686d
1 changed files with 41 additions and 41 deletions
|
@ -27,51 +27,51 @@ ThreadSafeDynamicsWorld::ThreadSafeDynamicsWorld(
|
|||
: btDiscreteDynamicsWorld(dispatcher, pairCache, constraintSolver, collisionConfiguration) {
|
||||
}
|
||||
|
||||
int ThreadSafeDynamicsWorld::stepSimulation( btScalar timeStep, int maxSubSteps, btScalar fixedTimeStep) {
|
||||
int ThreadSafeDynamicsWorld::stepSimulation( btScalar timeStep, int maxSubSteps, btScalar fixedTimeStep) {
|
||||
BT_PROFILE("stepSimulation");
|
||||
int subSteps = 0;
|
||||
if (maxSubSteps) {
|
||||
//fixed timestep with interpolation
|
||||
m_fixedTimeStep = fixedTimeStep;
|
||||
m_localTime += timeStep;
|
||||
if (m_localTime >= fixedTimeStep)
|
||||
{
|
||||
subSteps = int( m_localTime / fixedTimeStep);
|
||||
m_localTime -= subSteps * fixedTimeStep;
|
||||
}
|
||||
} else {
|
||||
//variable timestep
|
||||
fixedTimeStep = timeStep;
|
||||
m_localTime = m_latencyMotionStateInterpolation ? 0 : timeStep;
|
||||
m_fixedTimeStep = 0;
|
||||
if (btFuzzyZero(timeStep))
|
||||
{
|
||||
subSteps = 0;
|
||||
maxSubSteps = 0;
|
||||
} else
|
||||
{
|
||||
subSteps = 1;
|
||||
maxSubSteps = 1;
|
||||
}
|
||||
}
|
||||
int subSteps = 0;
|
||||
if (maxSubSteps) {
|
||||
//fixed timestep with interpolation
|
||||
m_fixedTimeStep = fixedTimeStep;
|
||||
m_localTime += timeStep;
|
||||
if (m_localTime >= fixedTimeStep)
|
||||
{
|
||||
subSteps = int( m_localTime / fixedTimeStep);
|
||||
m_localTime -= subSteps * fixedTimeStep;
|
||||
}
|
||||
} else {
|
||||
//variable timestep
|
||||
fixedTimeStep = timeStep;
|
||||
m_localTime = m_latencyMotionStateInterpolation ? 0 : timeStep;
|
||||
m_fixedTimeStep = 0;
|
||||
if (btFuzzyZero(timeStep))
|
||||
{
|
||||
subSteps = 0;
|
||||
maxSubSteps = 0;
|
||||
} else
|
||||
{
|
||||
subSteps = 1;
|
||||
maxSubSteps = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*//process some debugging flags
|
||||
if (getDebugDrawer()) {
|
||||
btIDebugDraw* debugDrawer = getDebugDrawer ();
|
||||
gDisableDeactivation = (debugDrawer->getDebugMode() & btIDebugDraw::DBG_NoDeactivation) != 0;
|
||||
}*/
|
||||
if (subSteps) {
|
||||
//clamp the number of substeps, to prevent simulation grinding spiralling down to a halt
|
||||
int clampedSimulationSteps = (subSteps > maxSubSteps)? maxSubSteps : subSteps;
|
||||
/*//process some debugging flags
|
||||
if (getDebugDrawer()) {
|
||||
btIDebugDraw* debugDrawer = getDebugDrawer ();
|
||||
gDisableDeactivation = (debugDrawer->getDebugMode() & btIDebugDraw::DBG_NoDeactivation) != 0;
|
||||
}*/
|
||||
if (subSteps) {
|
||||
//clamp the number of substeps, to prevent simulation grinding spiralling down to a halt
|
||||
int clampedSimulationSteps = (subSteps > maxSubSteps)? maxSubSteps : subSteps;
|
||||
|
||||
saveKinematicState(fixedTimeStep*clampedSimulationSteps);
|
||||
saveKinematicState(fixedTimeStep*clampedSimulationSteps);
|
||||
|
||||
applyGravity();
|
||||
applyGravity();
|
||||
|
||||
for (int i=0;i<clampedSimulationSteps;i++) {
|
||||
internalSingleStepSimulation(fixedTimeStep);
|
||||
}
|
||||
}
|
||||
for (int i=0;i<clampedSimulationSteps;i++) {
|
||||
internalSingleStepSimulation(fixedTimeStep);
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE: We do NOT call synchronizeMotionState() after each substep (to avoid multiple locks on the
|
||||
// object data outside of the physics engine). A consequence of this is that the transforms of the
|
||||
|
@ -80,7 +80,7 @@ int ThreadSafeDynamicsWorld::stepSimulation( btScalar timeStep, int maxSubSteps,
|
|||
// NOTE: We do NOT call synchronizeMotionStates() here. Instead it is called by an external class
|
||||
// that knows how to lock threads correctly.
|
||||
|
||||
clearForces();
|
||||
clearForces();
|
||||
|
||||
return subSteps;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue