From 946175385f0021e5262cf4c484343c5c2ba0b113 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 12 Dec 2008 13:41:39 +0000 Subject: [PATCH] From Ulrich Hertlein, Typo fixes + "optional parameter to RecordCameraPathHandler to control the frame rate for record/playback. Default is 25.0, the environment variable takes preference if set." --- include/osgGA/StateSetManipulator | 12 ++++++------ include/osgViewer/ViewerEventHandlers | 2 +- src/osgViewer/ViewerEventHandlers.cpp | 18 +++++++++++------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/include/osgGA/StateSetManipulator b/include/osgGA/StateSetManipulator index ad12fe148..db1ddcfdb 100644 --- a/include/osgGA/StateSetManipulator +++ b/include/osgGA/StateSetManipulator @@ -11,8 +11,8 @@ * OpenSceneGraph Public License for more details. */ -#ifndef OSGGA_STATESTATE_MANIPULATOR -#define OSGGA_STATESTATE_MANIPULATOR 1 +#ifndef OSGGA_STATESET_MANIPULATOR +#define OSGGA_STATESET_MANIPULATOR 1 #include #include @@ -23,7 +23,7 @@ #include -namespace osgGA{ +namespace osgGA { /** Experimental class, not been looked at for a while, but which will @@ -37,13 +37,13 @@ public: virtual const char* className() const { return "StateSetManipulator"; } - /** attach a STATESTATE to the manipulator to be used for specifying view.*/ + /** attach a StateSet to the manipulator to be used for specifying view.*/ virtual void setStateSet(osg::StateSet*); - /** get the attached a STATESTATE.*/ + /** get the attached a StateSet.*/ virtual osg::StateSet * getStateSet(); - /** get the attached a STATESTATE.*/ + /** get the attached a StateSet.*/ virtual const osg::StateSet * getStateSet() const; diff --git a/include/osgViewer/ViewerEventHandlers b/include/osgViewer/ViewerEventHandlers index d6fd43896..4831c51a8 100644 --- a/include/osgViewer/ViewerEventHandlers +++ b/include/osgViewer/ViewerEventHandlers @@ -234,7 +234,7 @@ class OSGVIEWER_EXPORT RecordCameraPathHandler : public osgGA::GUIEventHandler { public: - RecordCameraPathHandler(const std::string &filename = "saved_animation.path"); + RecordCameraPathHandler(const std::string &filename = "saved_animation.path", float fps = 25.0f); void setKeyEventToggleRecord(int key) { _keyEventToggleRecord = key; } int getKeyEventToggleRecord() const { return _keyEventToggleRecord; } diff --git a/src/osgViewer/ViewerEventHandlers.cpp b/src/osgViewer/ViewerEventHandlers.cpp index 502aad766..223b3e137 100644 --- a/src/osgViewer/ViewerEventHandlers.cpp +++ b/src/osgViewer/ViewerEventHandlers.cpp @@ -340,7 +340,7 @@ bool ThreadingHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIAction #if 1 case(osgViewer::ViewerBase::AutomaticSelection): viewerBase->setThreadingModel(osgViewer::ViewerBase::SingleThreaded); - osg::notify(osg::NOTICE)<<"Threading model 'AutomaticSelection' selected."<setThreadingModel(viewer->suggestBestThreadingModel()); @@ -373,7 +373,7 @@ bool ThreadingHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIAction return false; } -RecordCameraPathHandler::RecordCameraPathHandler(const std::string& filename): +RecordCameraPathHandler::RecordCameraPathHandler(const std::string& filename, float fps): _filename(filename), _autoinc( -1 ), _keyEventToggleRecord('z'), @@ -387,10 +387,14 @@ RecordCameraPathHandler::RecordCameraPathHandler(const std::string& filename): _animPath = new osg::AnimationPath(); const char* str = getenv("OSG_RECORD_CAMERA_PATH_FPS"); - - if (str) _interval = 1.0f / atof(str); - - else _interval = 1.0f / 25.0f; + if (str) + { + _interval = 1.0f / atof(str); + } + else + { + _interval = 1.0f / fps; + } } void RecordCameraPathHandler::getUsage(osg::ApplicationUsage &usage) const @@ -477,7 +481,7 @@ bool RecordCameraPathHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GU } } - // THe user has requested to STOP recording, write the file! + // The user has requested to STOP recording, write the file! else { _currentlyRecording = false;