SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
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.
Definition at line 35 of file SLAnimPlayback.h.
SLAnimPlayback::SLAnimPlayback | ( | SLAnimation * | parent, |
SLfloat | weight = 1.0f |
||
) |
Constructor
Definition at line 16 of file SLAnimPlayback.cpp.
Advances the time of the playback play based on its different easing parameters.
Definition at line 31 of file SLAnimPlayback.cpp.
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
Definition at line 175 of file SLAnimPlayback.cpp.
Inverse functions for the above easing curve functions.
Definition at line 215 of file SLAnimPlayback.cpp.
|
inline |
Definition at line 58 of file SLAnimPlayback.h.
Definition at line 71 of file SLAnimPlayback.h.
|
inline |
Definition at line 57 of file SLAnimPlayback.h.
|
inline |
Definition at line 70 of file SLAnimPlayback.h.
|
inline |
Definition at line 56 of file SLAnimPlayback.h.
Definition at line 69 of file SLAnimPlayback.h.
|
inline |
Definition at line 61 of file SLAnimPlayback.h.
|
inline |
Definition at line 60 of file SLAnimPlayback.h.
|
inline |
Definition at line 59 of file SLAnimPlayback.h.
|
inline |
Definition at line 62 of file SLAnimPlayback.h.
|
inline |
Definition at line 51 of file SLAnimPlayback.h.
Setter for the local time parameter. Takes the currently active easing curve into consideration.
Definition at line 158 of file SLAnimPlayback.cpp.
|
inline |
Definition at line 55 of file SLAnimPlayback.h.
|
inline |
Definition at line 68 of file SLAnimPlayback.h.
|
inline |
Definition at line 52 of file SLAnimPlayback.h.
void SLAnimPlayback::pause | ( | ) |
|
inline |
Definition at line 53 of file SLAnimPlayback.h.
Definition at line 66 of file SLAnimPlayback.h.
void SLAnimPlayback::playBackward | ( | ) |
Set this playback to be playing backward.
Definition at line 110 of file SLAnimPlayback.cpp.
void SLAnimPlayback::playForward | ( | ) |
Set this playback to be playing forward.
Definition at line 102 of file SLAnimPlayback.cpp.
void SLAnimPlayback::skipToEnd | ( | ) |
Set the local time of this animation to the end time.
Definition at line 150 of file SLAnimPlayback.cpp.
void SLAnimPlayback::skipToNextKeyframe | ( | ) |
Set the local time of this playback to be on the time of the next keyframe.
Definition at line 127 of file SLAnimPlayback.cpp.
void SLAnimPlayback::skipToPrevKeyframe | ( | ) |
Set the local time of this playback to be on the time of the previous keyframe.
Definition at line 135 of file SLAnimPlayback.cpp.
void SLAnimPlayback::skipToStart | ( | ) |
Set the local time of this playback to the starting time.
Definition at line 143 of file SLAnimPlayback.cpp.
|
inline |
Definition at line 54 of file SLAnimPlayback.h.
Definition at line 67 of file SLAnimPlayback.h.
|
protected |
the animation this plays is referencing
Definition at line 79 of file SLAnimPlayback.h.
|
protected |
easing modifier curve (to customize start and end point easing)
Definition at line 85 of file SLAnimPlayback.h.
|
protected |
is this animation running
Definition at line 84 of file SLAnimPlayback.h.
|
protected |
Did this playback change in the last frame.
Definition at line 88 of file SLAnimPlayback.h.
|
protected |
linear local time used for _easing propert
Definition at line 86 of file SLAnimPlayback.h.
|
protected |
the current local timestamp (eased time)
Definition at line 80 of file SLAnimPlayback.h.
|
protected |
We support different looping behaviours.
Definition at line 87 of file SLAnimPlayback.h.
|
protected |
the current playback direction
Definition at line 83 of file SLAnimPlayback.h.
|
protected |
the current playback speed
Definition at line 82 of file SLAnimPlayback.h.
|
protected |
the current weight
Definition at line 81 of file SLAnimPlayback.h.