From c3af8b1c8e89676e0ee7c3554efe3e3d1af7f951 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 9 Oct 2008 08:52:14 +0000 Subject: [PATCH] Fixed the frame rate reporting so that it handles the case when animation is slowed or speeded up --- src/osgGA/AnimationPathManipulator.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/osgGA/AnimationPathManipulator.cpp b/src/osgGA/AnimationPathManipulator.cpp index c77143383..33d4f9675 100644 --- a/src/osgGA/AnimationPathManipulator.cpp +++ b/src/osgGA/AnimationPathManipulator.cpp @@ -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 "<