Modifica di update() per gestire moltiplicatore tempo

This commit is contained in:
2026-06-22 12:16:32 +02:00
parent f05db110ff
commit c6094c6a44
18 changed files with 35 additions and 25 deletions
+2 -2
View File
@@ -85,12 +85,12 @@ void rigidbody::calcPos(const float Dtime){
}
}
void rigidbody::step(const sf::Clock time){
void rigidbody::step(const sf::Clock time, float multiplier){
int64_t Dtime = time.getElapsedTime().asMicroseconds();
if (prevT == 0) prevT = Dtime;
float dt = (float(Dtime) / 1000000.0) - (float(prevT) / 1000000.0);
float dt = ((float(Dtime) / 1000000.0) - (float(prevT) / 1000000.0)) * multiplier;
prevT = Dtime;
calcRot(dt);