25 #ifndef WGEANIMATIONMANIPULATOR_H
26 #define WGEANIMATIONMANIPULATOR_H
28 #include <osg/Version>
32 #if( ( OPENSCENEGRAPH_MAJOR_VERSION > 2 ) || ( OPENSCENEGRAPH_MAJOR_VERSION == 2 && ( OPENSCENEGRAPH_MINOR_VERSION > 9 || \
33 ( OPENSCENEGRAPH_MINOR_VERSION == 9 && OPENSCENEGRAPH_PATCH_VERSION >= 8 ) ) ) )
34 #include <osgGA/CameraManipulator>
37 typedef CameraManipulator MatrixManipulator;
40 #include <osgGA/MatrixManipulator>
43 #include "../../common/WTimer.h"
44 #include "../../common/WRealtimeTimer.h"
57 typedef osg::ref_ptr< WGEAnimationManipulator >
RefPtr;
62 typedef osg::ref_ptr< const WGEAnimationManipulator >
ConstRefPtr;
82 virtual void setByMatrix(
const osg::Matrixd& matrix );
115 virtual bool handle(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
123 virtual void init(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
131 virtual void home(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
138 virtual void home(
double currentTime );
New OSG manipulator: AnimationManipulator.
osg::ref_ptr< WGEAnimationManipulator > RefPtr
Convenience typedef.
virtual void setByMatrix(const osg::Matrixd &matrix)
Sets the current matrix of this animation manipulator.
virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
Handles incoming events send by the event dispatcher of the view.
void handleFrame()
This method updates m_matrix per frame according to time elapsed.
virtual osg::Matrixd getMatrix() const
Gets the current animation matrix for the current time-step.
virtual ~WGEAnimationManipulator()
Destructor.
osg::ref_ptr< const WGEAnimationManipulator > ConstRefPtr
Convenience typedef.
double m_homeOffsetTime
If home() is called, the homeOffsetTime stores the timers current value.
virtual void init(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
Initializes this manipulator.
WTimer::ConstSPtr m_timer
This timer keeps track of the current animation-time.
virtual void setTimer(WTimer::ConstSPtr timer)
Allows to switch the timer type.
osg::Matrixd m_matrix
The view matrix.
virtual void setByInverseMatrix(const osg::Matrixd &matrix)
Sets the current inverse matrix of this animation manipulator.
virtual osg::Matrixd getInverseMatrix() const
Gets the current inverse animation matrix for the current time-step.
virtual void home(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us)
Sets the manipulator back to its default.
WGEAnimationManipulator(WTimer::ConstSPtr timer=WTimer::ConstSPtr(new WRealtimeTimer()))
Constructs a animation path manipulator using a realtime timer if not specified.
std::shared_ptr< const WTimer > ConstSPtr
Convenience typedef for a const shared_ptr.