From 735859ed5867ddd42f96a6be894ecae50727d7a5 Mon Sep 17 00:00:00 2001 From: Pc Date: Fri, 17 Jan 2025 00:06:03 +0100 Subject: [PATCH] Kolizja Movment V2 --- main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.cpp b/main.cpp index 8f2c5e7..2f7c2d5 100644 --- a/main.cpp +++ b/main.cpp @@ -85,10 +85,9 @@ std::time_t monitormodehelper; FPSCounter fpsCounter; static const int targetFPS = 144; // Celowany FPS //Fps counter - void LimitFPS(int targetFPS) { - static auto lastTime = std::chrono::steady_clock::now(); - auto currentTime = std::chrono::steady_clock::now(); + static auto lastTime = std::chrono::high_resolution_clock::now(); + auto currentTime = std::chrono::high_resolution_clock::now(); std::chrono::duration elapsed = currentTime - lastTime; // Obliczamy czas na jedną klatkę @@ -118,7 +117,7 @@ float MoveSpeed = 1.0f; // Prędkość poruszania się float velocity = 0.0f; // Aktualna prędkość łazika -const float friction = 0.05f; // Współczynnik tarcia (μ) +const float friction = 0.1f; // Współczynnik tarcia (μ) const float maxSpeed = 3.0f; // Maksymalna prędkość łazika const float acceleration = 0.2f;