Fixed the frame rate reporting so that it handles the case when animation is slowed or speeded up

This commit is contained in:
Robert Osfield 2008-10-09 08:52:14 +00:00
parent e41ee9f951
commit c3af8b1c8e

View File

@ -171,9 +171,12 @@ void AnimationPathManipulator::handleFrame( double time )
if (_printOutTimingInfo)
{
double delta = (animTime-_animStartOfTimedPeriod);
if (delta>=_animationPath->getPeriod())
double animDelta = (animTime-_animStartOfTimedPeriod);
if (animDelta>=_animationPath->getPeriod())
{
double delta = time-_realStartOfTimedPeriod;
double frameRate = (double)_numOfFramesSinceStartOfTimedPeriod/delta;
osg::notify(osg::NOTICE) <<"AnimatonPath completed in "<<delta<<" seconds, completing "<<_numOfFramesSinceStartOfTimedPeriod<<" frames,"<<std::endl;
osg::notify(osg::NOTICE) <<" average frame rate = "<<frameRate<<std::endl;