Page 2 of 2

Posted: Fri Apr 24, 2009 12:19 am
by ulao
If animations are too fast, node->setAnimationSpeed() would do it, no matter the refresh frequency.
- animation are not the problem they work right as they are fps / time based anyways.

arras, This is sort of what I was trying to get at. But for my I'm dev'ing on a very slow system. And I dont see anyone try on a slow one. But it is possible, I can't rule it out. I agree with the approach you mentioned. Just, was not sure how to track a globe unit, or rather calculate it. I guess I could put some code in my update and get before and after times and some how get the unit i need.. I may give this a go. This is what I did to fix the animation call in the irrlicht code so that the animation speed could be changed on the fly. Thx for the idea..

maybe somthing like

Code: Select all

			s32 timeNow = device->getTimer()->getTime();
			s32 elapsedTime = timeNow - lastTime;
			lastTime = timeNow;

Nox's solution work great for the mean time.

Posted: Fri Apr 24, 2009 6:24 am
by arras
Yes, that code will work. Just implement it the right way (which depend on your application). Somehow you have to make elapsedTime available in part of code which is responsible for your actions on nodes.

Posted: Fri Apr 24, 2009 6:38 am
by Nox
Well in fact i use this for my codes (no irrlicht solution but only as a hint):

Code: Select all

while(run)
{
	SYSTEM_TICKS DeltaMS = act_time.GetDiffMSTick();
	act_time.TimeStamp();
	Sector->Update(DeltaMS);

	Sector->TimeNeeded = act_time.GetDiffMSTick();
	if(TIMEFORSECTORTHREAD > Sector->TimeNeeded)
		PortableSleep(TIMEFORSECTORTHREAD - Sector->TimeNeeded);
}

Posted: Sat Apr 25, 2009 1:46 am
by ulao
Ya I have put that in my general update and will be able to pass it down the update chain.

I planned on doing it like Nox did.

Thx to you both.