Modifica di update() per gestire moltiplicatore tempo
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user