From e082428314323299f1900a665d9762178ca0d7b1 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Tue, 25 Feb 2025 09:28:31 +0100 Subject: [PATCH] fix: fixed framerate for physics. might make it a little more stable --- core/src/physics/simulation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/physics/simulation.cpp b/core/src/physics/simulation.cpp index 693d80a..6782e95 100644 --- a/core/src/physics/simulation.cpp +++ b/core/src/physics/simulation.cpp @@ -73,7 +73,7 @@ void syncPartPhysics(std::shared_ptr part) { void physicsStep(float deltaTime) { // Step the simulation a few steps - world->update(deltaTime / 2); + world->update(std::min(deltaTime / 2, (1/60.f))); // Naive implementation. Parts are only considered so if they are just under Workspace // TODO: Add list of tracked parts in workspace based on their ancestry using inWorkspace property of Instance