- Code: Select all
int loops = 0;
physicLoopsTimeAcc = 0;
while ((loops < MAX_PHYSICS_LOOPS) && (g_timeAccumulator >= DEMO_FPS_IN_MICROSECUNDS))
{
loops ++;
// Process incoming events.
ProcessEvents (g_world);
// sample time before the Update
g_physicTime = GetTimeInMicrosenconds ();
// run the newton update function
NewtonUpdate (g_world, (1.0f / DEMO_PHYSICS_FPS));
// calculate the time spent in the physical Simulation
g_physicTime = GetTimeInMicrosenconds () - g_physicTime;
// call the visual debugger to show the physics scene
#ifdef USE_VISUAL_DEBUGGER
NewtonDebuggerServe (g_newtonDebugger, g_world);
#endif
// subtract time from time accumulator
g_timeAccumulator -= DEMO_FPS_IN_MICROSECUNDS;
physicTime ++;
physicLoopsTimeAcc += g_physicTime;
}
if (loops > MAX_PHYSICS_LOOPS) {
g_physicTime = physicLoopsTimeAcc;
g_timeAccumulator = DEMO_FPS_IN_MICROSECUNDS;
}
i'm wromg or
- Code: Select all
if (loops > MAX_PHYSICS_LOOPS) {
g_physicTime = physicLoopsTimeAcc;
g_timeAccumulator = DEMO_FPS_IN_MICROSECUNDS;
as is never will be executed?

