A handy feature...

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
Nessie

A handy feature...

Post by Nessie »

One thing that I think would be hugely useful is a handy function call to the ITimer dude...basically, give me the frametime, preferably as an f32, where 1.0 = 1 second and 0.5 = .5 seconds, etc..

This kind of thing is used everywhere in games, like Quake3.

As an example, I wrote some simple code to dynamically fly my camera around, taking into account a couple of variables, like who should be framed up in the scene, etc. Having a preset path would never work for what I'm doing.

The problem I had was that I couldn't simply add a set amount to the camera position and really have it work correctly.

Why not? Well, the camera movement speed becomes highly dependant on the current frame rate. I could get the current time and have a copy of the time from the previous frame, then work it all out, but it would just be nice to ask the ITimer dude to give me that information.

Another thing that would be hugely useful is for the ITimer guy to take a timescale factor, something like, 2.0f = 2x faster than normal.

For debugging or doing bullet-time effects, being able to slow the game down is cool...or even being able to speed the game up. I was able to rig this up for the game elements I programmed using the engine, but the animation system was completely removed from all of that, so, without this kind of feature, bullet-time isn't so easy to achieve.

If anyone thinks these things are really useful, I might be willing to help out with adding these features. If there is a better way to do these kinds of things, I'd love to hear about it.
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Yes, and even a pause option would be cool. Some other guys asked for thinks like that before, and this is already on my todolist. But until it is implemented by me, it would be not much work to add functionality like this to the engine or a wrapper by yourself.
Nessie
Posts: 14
Joined: Thu Apr 08, 2004 4:27 pm
Location: Madison, WI, USA

Post by Nessie »

Right, I posted some code in the 'bug' section even though it wasn't exactly a bug. By setting the timeScale factor to 0 in the presented code, the engine can be made to be paused.

It would be easy enough to make pause/un-pause their own methods as well.
"Build a man a fire and he'll be warm for the evening. Set a man on fire and he'll be warm for the rest of his life." -unknown
Post Reply