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."

This commit is contained in:
Robert Osfield 2008-12-12 13:41:39 +00:00
parent 55fe4967ad
commit 946175385f
3 changed files with 18 additions and 14 deletions

View File

@ -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 <osgGA/Export>
#include <osgGA/GUIEventAdapter>
@ -23,7 +23,7 @@
#include <osg/PolygonMode>
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;

View File

@ -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; }

View File

@ -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."<<std::endl;
osg::notify(osg::NOTICE)<<"Threading model 'SingleThreaded' selected."<<std::endl;
#else
case(osgViewer::ViewerBase::AutomaticSelection):
viewerBase->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;