Space Flight/Combat Tech Demo #1.2

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
CodyCer0
Posts: 41
Joined: Mon Dec 08, 2008 3:07 am

Post 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.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post 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.
Post Reply