2022-09-15 12:10:06 +08:00
|
|
|
#include "SHpch.h"
|
2022-09-14 10:32:50 +08:00
|
|
|
#include "SHFixedSystemRoutine.h"
|
|
|
|
#include "../SHECSMacros.h"
|
|
|
|
|
|
|
|
namespace SHADE
|
|
|
|
{
|
|
|
|
|
2022-09-15 12:10:06 +08:00
|
|
|
void SHFixedSystemRoutine::Execute(double dt) noexcept
|
2022-09-14 10:32:50 +08:00
|
|
|
{
|
|
|
|
accumulatedTime += dt;
|
|
|
|
int counter = 0;
|
|
|
|
while (accumulatedTime >= fixedTimeStep)
|
|
|
|
{
|
|
|
|
++counter;
|
|
|
|
accumulatedTime -= fixedTimeStep;
|
|
|
|
FixedExecute(fixedTimeStep);
|
|
|
|
}
|
|
|
|
stats.numSteps = counter;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|