feat(physics): changed max fps from 30 to 60

This commit is contained in:
maelstrom 2025-07-01 14:44:46 +02:00
parent e829b0c279
commit 3052b376e2

View file

@ -4,6 +4,7 @@
#include "mainglwidget.h"
#include "mainwindow.h"
#include "objects/service/script/scriptcontext.h"
#include <chrono>
#include <memory>
#include <mutex>
#include <qboxlayout.h>
@ -43,7 +44,7 @@ private:
gWorkspace()->PhysicsStep(float(deltaTime)/1'000'000);
}
std::this_thread::sleep_for(std::chrono::milliseconds(33 - deltaTime/1000));
std::this_thread::sleep_for(std::chrono::microseconds(16'667 - deltaTime));
std::unique_lock lock(sync);
runningCond.wait(lock, [&]{ return running || quit; });