SLProject 4.0.000
|
Manages the playback of an SLAnimation. More...
#include <SLAnimPlayback.h>
Public Member Functions | |
SLAnimPlayback (SLAnimation *parent, SLfloat weight=1.0f) | |
void | playForward () |
void | playBackward () |
void | pause () |
void | skipToNextKeyframe () |
void | skipToPrevKeyframe () |
void | skipToStart () |
void | skipToEnd () |
SLfloat | localTime () const |
SLAnimation * | parentAnimation () |
SLfloat | playbackRate () const |
SLfloat | weight () const |
SLAnimLooping | loop () const |
SLbool | enabled () const |
SLEasingCurve | easing () const |
SLbool | changed () const |
SLbool | isPlayingForward () const |
SLbool | isPlayingBackward () const |
SLbool | isPaused () const |
SLbool | isStopped () const |
void | localTime (SLfloat time) |
void | playbackRate (SLfloat pr) |
void | weight (SLfloat weight) |
void | loop (SLAnimLooping lb) |
void | enabled (SLbool val) |
void | easing (SLEasingCurve ec) |
void | changed (SLbool changed) |
void | advanceTime (SLfloat delta) |
SLfloat | calcEasingTime (SLfloat time) const |
Applies the easing time curve to the input time. More... | |
SLfloat | calcEasingTimeInv (SLfloat time) const |
Protected Attributes | |
SLAnimation * | _animation |
the animation this plays is referencing More... | |
SLfloat | _localTime |
the current local timestamp (eased time) More... | |
SLfloat | _weight |
the current weight More... | |
SLfloat | _playbackRate |
the current playback speed More... | |
SLshort | _playbackDir |
the current playback direction More... | |
SLbool | _enabled |
is this animation running More... | |
SLEasingCurve | _easing |
easing modifier curve (to customize start and end point easing) More... | |
SLfloat | _linearLocalTime |
linear local time used for _easing propert More... | |
SLAnimLooping | _loopingBehaviour |
We support different looping behaviours. More... | |
SLbool | _gotChanged |
Did this playback change in the last frame. More... | |
Manages the playback of an SLAnimation.
This class manages the playback state and the local time of an SLAnimation. It manages the way the time advances and how the animation loops. It has all functionality to play, pause, stop, enable, speedup and slowdown a playback. A list of all SLAnimPlayback is hold by the SLAnimManager.
It is possible to have multiple playbacks per animation. If we keep track of which nodes are affected by which SLAnimPlayback we can only manipulate these nodes for the time kept in the SLAnimPlayback. A practical example for this behaviour would be special skeleton instances that only keep track of SLAnimPlayback for their parent SLAnimSkeleton. The skeleton instance can then change its skeletal data based on the states and the actual SLAnimation has to only exist once in memory.
SLAnimPlayback::SLAnimPlayback | ( | SLAnimation * | parent, |
SLfloat | weight = 1.0f |
||
) |
Constructor
void SLAnimPlayback::advanceTime | ( | SLfloat | delta | ) |
Advances the time of the playback play based on its different easing parameters.
Applies the easing time curve to the input time.
See also the declaration of the SLEasingCurve enumeration for the different easing curve type that are taken from Qt QAnimation and QEasingCurve class. See http://qt-project.org/doc/qt-4.8/qeasingcurve.html#Type-enum
Inverse functions for the above easing curve functions.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void SLAnimPlayback::localTime | ( | SLfloat | time | ) |
Setter for the local time parameter. Takes the currently active easing curve into consideration.
|
inline |
|
inline |
|
inline |
void SLAnimPlayback::pause | ( | ) |
Set this playback to be paused.
|
inline |
|
inline |
void SLAnimPlayback::playBackward | ( | ) |
Set this playback to be playing backward.
void SLAnimPlayback::playForward | ( | ) |
Set this playback to be playing forward.
void SLAnimPlayback::skipToEnd | ( | ) |
Set the local time of this animation to the end time.
void SLAnimPlayback::skipToNextKeyframe | ( | ) |
Set the local time of this playback to be on the time of the next keyframe.
void SLAnimPlayback::skipToPrevKeyframe | ( | ) |
Set the local time of this playback to be on the time of the previous keyframe.
void SLAnimPlayback::skipToStart | ( | ) |
Set the local time of this playback to the starting time.
|
inline |
|
inline |
|
protected |
the animation this plays is referencing
|
protected |
easing modifier curve (to customize start and end point easing)
|
protected |
is this animation running
|
protected |
Did this playback change in the last frame.
|
protected |
linear local time used for _easing propert
|
protected |
the current local timestamp (eased time)
|
protected |
We support different looping behaviours.
|
protected |
the current playback direction
|
protected |
the current playback speed
|
protected |
the current weight