From 348870d7ba355f59badda59d7e697e9c6fbf519d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 17 Dec 2010 11:19:29 +0000 Subject: [PATCH] Added --speed command line parameter to osgviewer to enable control of the speed that animation paths are played back at. --- applications/osgviewer/osgviewer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/applications/osgviewer/osgviewer.cpp b/applications/osgviewer/osgviewer.cpp index 209b3a2c9..d94a0f5fe 100644 --- a/applications/osgviewer/osgviewer.cpp +++ b/applications/osgviewer/osgviewer.cpp @@ -90,12 +90,16 @@ int main(int argc, char** argv) keyswitchManipulator->addMatrixManipulator( '7', "Spherical", new osgGA::SphericalManipulator() ); std::string pathfile; + double animationSpeed = 1.0; + while(arguments.read("--speed",animationSpeed) ) {} char keyForAnimationPath = '8'; while (arguments.read("-p",pathfile)) { osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); if (apm || !apm->valid()) { + apm->setTimeScale(animationSpeed); + unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); keyswitchManipulator->addMatrixManipulator( keyForAnimationPath, "Path", apm ); keyswitchManipulator->selectMatrixManipulator(num);