Page 2 of 2

Posted: Tue Dec 09, 2008 1:10 am
by CodyCer0
I really can't get this right, can someone please help, I try to multiply the movement, but it don't work right at all.

Posted: Sun Dec 28, 2008 5:09 pm
by arras
I really can't get this right, can someone please help, I try to multiply the movement, but it don't work right at all.
rogerborg was posting principle and that is pretty much all you need.

Code: Select all

u32 time = Timer->getTime();
u32 deltaT = time - OldTime;
if(deltaT != 0) OldTime = time;
f32 deltaTS = (f32)deltaT / 1000.0f;
f32 rVelocity = Velocity * deltaTS;
OldTime is stored between frames.

Velocity is general velocity of your object in units per second which you want to archieve.

rVelocity is velocity per frame which you want to apply on your object that frame.