change time factor behaviour to allow editing

This commit is contained in:
2021-02-03 16:35:37 +01:00
parent 8e757af8d1
commit 7912b58108
4 changed files with 7 additions and 9 deletions

View File

@ -95,9 +95,8 @@ void OrganizerSceneService::sceneFixedUpdate(Engine&) {
size_t continuous_counter = 0;
auto& time_ctx = _scene->ctx_or_set<MM::Components::TimeDelta>(f_delta, delta_factor);
time_ctx.tickDelta = f_delta * delta_factor;
time_ctx.deltaFactor = delta_factor;
auto& time_ctx = _scene->ctx_or_set<MM::Components::TimeDelta>(f_delta, initial_delta_factor);
time_ctx.tickDelta = f_delta * time_ctx.deltaFactor;
// TODO: this while is just cancer
while (_accumulator >= static_cast<decltype(_accumulator)>(dt)){

View File

@ -21,7 +21,7 @@ namespace MM::Services {
public:
const float f_delta;
float delta_factor = 1.f;
float initial_delta_factor = 1.f;
public: // service
explicit OrganizerSceneService(const float update_delta = 1.f/60.f) : f_delta(update_delta) {}