Added continuous recording of the animation path to the RecordAnimationPathHandler

This commit is contained in:
Robert Osfield
2008-05-26 17:30:43 +00:00
parent 7592e50cde
commit cac6e2facb
4 changed files with 35 additions and 12 deletions

View File

@@ -116,7 +116,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
matrix.preMult(osg::Matrixd::rotate(_rotation.inverse()));
matrix.preMult(osg::Matrixd::translate(-_position));
}
protected:
osg::Vec3d _position;
@@ -164,6 +164,7 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
/** Given a specific time, return the local ControlPoint frame for a point. */
virtual bool getInterpolatedControlPoint(double time,ControlPoint& controlPoint) const;
/** Insert a control point into the AnimationPath.*/
void insert(double time,const ControlPoint& controlPoint);
double getFirstTime() const { if (!_timeControlPointMap.empty()) return _timeControlPointMap.begin()->first; else return 0.0;}
@@ -200,6 +201,9 @@ class OSG_EXPORT AnimationPath : public virtual osg::Object
/** Write the animation path to a flat ASCII file stream. */
void write(std::ostream& out) const;
/** Write the control point to a flat ASCII file stream. */
void write(TimeControlPointMap::const_iterator itr, std::ostream& out) const;
protected:
virtual ~AnimationPath() {}

View File

@@ -22,6 +22,8 @@
#include <osgViewer/GraphicsWindow>
#include <osgViewer/Viewer>
#include <fstream>
namespace osgViewer {
/** Event handler for adding on screen help to Viewers.*/
@@ -241,6 +243,7 @@ public:
protected:
std::string _filename;
std::ofstream _fout;
int _keyEventToggleRecord;
int _keyEventTogglePlayback;