If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
pakata
Posts: 18 Joined: Tue Sep 23, 2008 11:51 pm
Location: korea rep of
Post
by pakata » Tue Oct 07, 2008 12:29 am
in high FPS like 300 frame per sec
caculating is so fast
it cause something problem ex)move faster....
in low fps like 7frame per sec
cant move...
Code: Select all
float speedfixed=0,speedcriterion=500;
speedfixed=float(speedcriterion/float(driver->getFPS()));
10 fps speed = 50 processed 1 sec 10x50=500
100 fps speed = 5 processed 1 sec 100x5=500
B@z
Posts: 876 Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary
Post
by B@z » Tue Oct 07, 2008 12:44 am
you have to multiply it with deltaT
Code: Select all
oldtime = timer;
timer = (f32)device->getTimer()->getTime() / 1000.0f;
deltaT = timer - oldtime;
pakata
Posts: 18 Joined: Tue Sep 23, 2008 11:51 pm
Location: korea rep of
Post
by pakata » Tue Oct 07, 2008 12:57 am
need timer?
some confuse with sentence... ;;
rogerborg
Admin
Posts: 3590 Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:
Post
by rogerborg » Tue Oct 07, 2008 7:41 am
Don't use getFPS().
Code: Select all
u32 then = device->getTimer()->getTime();
while(device->run())
{
const u32 now = device->getTimer()->getTime();
const f32 delta = (now - then) * .001f;
then = now;
//... the rest of your main loop.
// Multiply any movements or rotations by "delta"
}
I can't really make it much simpler than that.
pakata
Posts: 18 Joined: Tue Sep 23, 2008 11:51 pm
Location: korea rep of
Post
by pakata » Tue Oct 07, 2008 8:47 am
thx @@