From df74f3ba8af013e95d3ec77dc9fcc3e6224b804d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 23 Mar 2008 18:28:49 +0000 Subject: [PATCH] Added < and > key bindings to allow the speed to be animation speed to be increased or decreased. --- src/osgGA/AnimationPathManipulator.cpp | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/osgGA/AnimationPathManipulator.cpp b/src/osgGA/AnimationPathManipulator.cpp index bbb7c402c..c77143383 100644 --- a/src/osgGA/AnimationPathManipulator.cpp +++ b/src/osgGA/AnimationPathManipulator.cpp @@ -85,12 +85,42 @@ bool AnimationPathManipulator::handle(const osgGA::GUIEventAdapter& ea,osgGA::GU if (ea.getKey()==' ') { _isPaused = false; + _timeScale = 1.0; + home(ea,us); us.requestRedraw(); us.requestContinuousUpdate(false); return true; } + else if (ea.getKey()=='>') + { + double time = _isPaused ? _pauseTime : ea.getTime(); + double animationTime = (time+_timeOffset)*_timeScale; + + _timeScale *= 1.1; + + osg::notify(osg::NOTICE)<<"Animation speed = "<<_timeScale*100<<"%"<