From 3052b376e2ca30d64f0c3d29468abb647f39c792 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Tue, 1 Jul 2025 14:44:46 +0200 Subject: [PATCH] feat(physics): changed max fps from 30 to 60 --- editor/placedocument.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editor/placedocument.cpp b/editor/placedocument.cpp index 3e5db93..3ed1253 100644 --- a/editor/placedocument.cpp +++ b/editor/placedocument.cpp @@ -4,6 +4,7 @@ #include "mainglwidget.h" #include "mainwindow.h" #include "objects/service/script/scriptcontext.h" +#include #include #include #include @@ -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; });