Frame listeners and my crappy programming.

Problems building or running the engine, queries about how to use features etc.
User avatar
c_olin
Kobold
Posts: 25
Joined: Sun Jan 02, 2005 2:25 am

Frame listeners and my crappy programming.

Post by c_olin »

I'm pretty new to Ogre. I've messed around with it a bit, and I have to say, I like what I see, by far the best object oriented graphics engine around. But there is only one problem.

Whenever I used other 3d engine, I would normal set up my framework with just one class instance, IE 'CGame'. And I made other classes like an Entity Manager etc and made one instance for each of those classes in 'CGame'. And it all worked out fine.

But in Ogre it appears as if the only possible way to do time based movement is through a frame listener and then atatch that frame listener to the root of 'CGame'. That would mean that all objects that move would be passed through the frame listener?

Maybe I'm taking the wrong way as far as framework... How do you guys set up the framework for your games?
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8

Post by haffax »

team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
c_olin
Kobold
Posts: 25
Joined: Sun Jan 02, 2005 2:25 am

Post by c_olin »

Thanks for the post, I should have tried searching a bit harder.... one last question. How would I handle time based movement without a frame listener? I'm aware that if you multiply the movement by the amount of time between the last frame gives you a constant speed. But how can I get the frame interval? Thank you
User avatar
Emmeran
Goblin
Posts: 272
Joined: Wed Jun 02, 2004 11:47 am
Location: Erlangen

Post by Emmeran »

with the framelistener you can get it in frameStarted/-Ended by evt.mTimeSinceLastFrame or by creating a timer and using it's getMilliseconds() function (-> ogre api or search)