Page 1 of 1
Timer & FPS
Posted: Sat Sep 03, 2005 5:20 pm
by gershon
why is my delta-time constantly changing?
u32 time = timer->getTime()
float dt = (float)( time - time2 )
time2 = time
Posted: Sun Sep 04, 2005 8:06 am
by Guest
Because that is what Delta time does. If it was constant all the time there would be no need for it
It measures how long the last frame took and returns the result - which can always fluctuate.
However large fluctuations are a sign of something bad in your code, but you didn't post your average results so I don't know how bad they are!?
Posted: Sun Sep 04, 2005 8:35 pm
by gershon
donno what i did exacty, movment was jercky but now it working...
at ~200 fps i get values of 1-44.
i use it as:
v = a * (dt/1000)
Posted: Mon Sep 05, 2005 6:24 am
by CZestmyr
I don't know what is your problem, but physical formulas are clear:
v = a * dt
s = v * dt
with relatively small dt, which is your case, you can use
v = a * t
s = v * t