timeSinceLastFrame problem

Discussion of issues specific to mobile platforms such as iOS, Android, Symbian and Meego.
User avatar
zafery
Kobold
Posts: 35
Joined: Thu Oct 25, 2007 10:37 am
x 1

timeSinceLastFrame problem

Post by zafery »

hi,

i am using ogre 1.7 with ios template

i think something is wrong with deltatime calculations.

void OgreFramework::updateOgre(double timeSinceLastFrame) function i try 1000/60 instead of timeSinceLastFrame gives me more soomth result. but in lower fps using 1000/60 might be a problem.

maybe i am wrong.

thanks...
User avatar
masterfalcon
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126

Re: timeSinceLastFrame problem

Post by masterfalcon »

The calculation looks correct to me. It's just the current time minus the time at the beginning of a frame. Does profiling your app reveal any hot spots?
User avatar
zafery
Kobold
Posts: 35
Joined: Thu Oct 25, 2007 10:37 am
x 1

Re: timeSinceLastFrame problem

Post by zafery »

i test it with your template with only adding the line below to "void OgreFramework::updateOgre(double timeSinceLastFrame)" function in OgreFramework.cpp

OgreFramework::getSingletonPtr()->m_pSceneMgr->getSceneNode("CubeNode")->roll(Ogre::Degree(timeSinceLastFrame/10)) ;

the line below gives more smooth result you can try :)
OgreFramework::getSingletonPtr()->m_pSceneMgr->getSceneNode("CubeNode")->roll(Ogre::Degree(100/60)) ;

i test it in my iphone device.

as i say before maybe i am wrong

thank...
User avatar
zafery
Kobold
Posts: 35
Joined: Thu Oct 25, 2007 10:37 am
x 1

Re: timeSinceLastFrame problem

Post by zafery »

hi

using getMilliseconds() instead of getMillisecondsCPU() is the right way i think.

but i don't understand why nobody has this problem. deltatime is very important for smooth results.

anyway use getMilliseconds() and also add a if state for bigger deltatime values.

thanks...