Sorry about this, but what if I want it to run at 'x' frames per second on low and and high end pc's.
Is this built in to Irrlicht or do I have to build it myself.
For example, if I am moving a vehicle 60 feet per second, I want to make sure that every loop (Say it is running at 60 frames per second) I move it forward 1 unit.
I want it to render as many times as possible, but only move st a steady pace, but as smooth as possible
NOOB: Limit to 'x' frames per second for every machine
-
- Posts: 12
- Joined: Mon May 22, 2006 2:56 pm
-
- Posts: 12
- Joined: Mon May 22, 2006 2:56 pm
Have you any sample code, even Pseudo
Thanks for your help
Looking at other code, this seems to work in C#.NET
Looking at other code, this seems to work in C#.NET
Code: Select all
private float _LastUpdate = 0.0f;
public float CalculateMoveTween(IrrlichtDevice device)
{
//http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?p=68133
// position += velocityPerMilisec * numberOfMiliSecsPassed;
ITimer timer = device.Timer;
float thisupdate = timer.Time;
float deltatime = ((thisupdate - _LastUpdate)/1000.0f);
_LastUpdate = thisupdate;
return deltatime;
}