OpenWalnut
1.5.0dev
|
New OSG manipulator: AnimationManipulator. More...
#include <WGEAnimationManipulator.h>
Public Types | |
typedef osg::ref_ptr< WGEAnimationManipulator > | RefPtr |
Convenience typedef. More... | |
typedef osg::ref_ptr< const WGEAnimationManipulator > | ConstRefPtr |
Convenience typedef. More... | |
Public Member Functions | |
WGEAnimationManipulator (WTimer::ConstSPtr timer=WTimer::ConstSPtr(new WRealtimeTimer())) | |
Constructs a animation path manipulator using a realtime timer if not specified. More... | |
virtual | ~WGEAnimationManipulator () |
Destructor. More... | |
virtual void | setByMatrix (const osg::Matrixd &matrix) |
Sets the current matrix of this animation manipulator. More... | |
virtual void | setByInverseMatrix (const osg::Matrixd &matrix) |
Sets the current inverse matrix of this animation manipulator. More... | |
virtual osg::Matrixd | getMatrix () const |
Gets the current animation matrix for the current time-step. More... | |
virtual osg::Matrixd | getInverseMatrix () const |
Gets the current inverse animation matrix for the current time-step. More... | |
virtual bool | handle (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) |
Handles incoming events send by the event dispatcher of the view. More... | |
virtual void | init (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) |
Initializes this manipulator. More... | |
virtual void | home (const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &us) |
Sets the manipulator back to its default. More... | |
virtual void | home (double currentTime) |
Sets the animation callback to a certain time. More... | |
virtual void | setTimer (WTimer::ConstSPtr timer) |
Allows to switch the timer type. More... | |
Private Member Functions | |
void | handleFrame () |
This method updates m_matrix per frame according to time elapsed. More... | |
Private Attributes | |
osg::Matrixd | m_matrix |
The view matrix. More... | |
WTimer::ConstSPtr | m_timer |
This timer keeps track of the current animation-time. More... | |
double | m_homeOffsetTime |
If home() is called, the homeOffsetTime stores the timers current value. More... | |
New OSG manipulator: AnimationManipulator.
Can play back animation paths (not osg::AnimationPath),
Definition at line 51 of file WGEAnimationManipulator.h.
typedef osg::ref_ptr< const WGEAnimationManipulator > WGEAnimationManipulator::ConstRefPtr |
Convenience typedef.
Definition at line 62 of file WGEAnimationManipulator.h.
typedef osg::ref_ptr< WGEAnimationManipulator > WGEAnimationManipulator::RefPtr |
Convenience typedef.
Definition at line 57 of file WGEAnimationManipulator.h.
WGEAnimationManipulator::WGEAnimationManipulator | ( | WTimer::ConstSPtr | timer = WTimer::ConstSPtr( new WRealtimeTimer() ) | ) |
Constructs a animation path manipulator using a realtime timer if not specified.
timer | the timer type |
Definition at line 35 of file WGEAnimationManipulator.cpp.
|
virtual |
Destructor.
Definition at line 43 of file WGEAnimationManipulator.cpp.
|
virtual |
Gets the current inverse animation matrix for the current time-step.
In most cases, this should be used as modelview matrix.
Definition at line 63 of file WGEAnimationManipulator.cpp.
References m_matrix.
|
virtual |
Gets the current animation matrix for the current time-step.
Definition at line 58 of file WGEAnimationManipulator.cpp.
References m_matrix.
|
virtual |
Handles incoming events send by the event dispatcher of the view.
ea | event adapter |
us | action adapter allowing interaction with the event dispatcher |
Definition at line 68 of file WGEAnimationManipulator.cpp.
References handleFrame().
|
private |
This method updates m_matrix per frame according to time elapsed.
Definition at line 326 of file WGEAnimationManipulator.cpp.
References Transformation::axeX, Transformation::axeY, Transformation::finish(), m_homeOffsetTime, m_matrix, and m_timer.
Referenced by handle().
|
virtual |
Sets the manipulator back to its default.
ea | event adapter |
us | action adapter allowing interaction with the event dispatcher |
Definition at line 92 of file WGEAnimationManipulator.cpp.
Referenced by init(), and setTimer().
|
virtual |
Sets the animation callback to a certain time.
currentTime | the time to which the manipulator should be set. |
Definition at line 97 of file WGEAnimationManipulator.cpp.
References m_homeOffsetTime, and m_timer.
|
virtual |
Initializes this manipulator.
This simply calls home( 0 ).
ea | event adapter |
us | action adapter allowing interaction with the event dispatcher |
Definition at line 87 of file WGEAnimationManipulator.cpp.
References home().
|
virtual |
Sets the current inverse matrix of this animation manipulator.
This is, in most cases, the modelview matrix. This most probably gets overwritten in the next frame by the current animation matrix.
matrix | the matrix to set |
Definition at line 53 of file WGEAnimationManipulator.cpp.
References m_matrix.
|
virtual |
Sets the current matrix of this animation manipulator.
This most probably gets overwritten in the next frame by the current animation matrix.
matrix | the matrix to set |
Definition at line 48 of file WGEAnimationManipulator.cpp.
References m_matrix.
|
virtual |
Allows to switch the timer type.
It continues animation at the current timer position.
timer | the timer |
Definition at line 102 of file WGEAnimationManipulator.cpp.
References home(), and m_timer.
|
private |
If home() is called, the homeOffsetTime stores the timers current value.
Definition at line 161 of file WGEAnimationManipulator.h.
Referenced by handleFrame(), and home().
|
private |
The view matrix.
Gets modified on a per-frame basis.
Definition at line 151 of file WGEAnimationManipulator.h.
Referenced by getInverseMatrix(), getMatrix(), handleFrame(), setByInverseMatrix(), and setByMatrix().
|
private |
This timer keeps track of the current animation-time.
Definition at line 156 of file WGEAnimationManipulator.h.
Referenced by handleFrame(), home(), and setTimer().