Lysa  0.0
Lysa 3D Engine
Tween Class Referenceabstract

Detailed Description

Base class for time-based animations (tweens). Tweens encapsulate a small, focused animation task that progresses with time.

+ Inheritance diagram for Tween:

Public Typedefs

using Callback = std::function< void ()>
 

Public Member Functions

virtual bool update (double deltaTime) = 0
 
virtual double getOverflow () const
 
virtual bool isRunning () const
 
virtual void kill ()
 
virtual ~Tween () = default
 

Protected Member Functions

 Tween (const TransitionType type, const Callback &callback)
 

Static Protected Member Functions

static double applyEase (TransitionType type, double t)
 

Protected Attributes

bool running {false}
 
Callback callback
 
TransitionType interpolationType
 

Member Typedef Documentation

using Callback = std::function<void()>

Callback invoked when the Tween completes.

Constructor & Destructor Documentation

virtual ~Tween ( )
virtualdefault
Tween ( const TransitionType  type,
const Callback callback 
)
inlineprotected

Member Function Documentation

static double applyEase ( TransitionType  type,
double  t 
)
staticprotected

Applies the easing curve to a normalized time value t in [0,1].

virtual double getOverflow ( ) const
inlinevirtual

Returns the time that overflowed past the end of this Tween (>= 0).

Reimplemented in lysa::PropertyTween::getOverflow()

virtual bool isRunning ( ) const
inlinevirtual

Returns true while the Tween is still animating.

Reimplemented in lysa::TweenSequence::isRunning()

virtual void kill ( )
inlinevirtual

Immediately stops the Tween without firing the completion callback.

Reimplemented in lysa::TweenSequence::kill()

virtual bool update ( double  deltaTime)
pure virtual

Advances the Tween by delta time.

Parameters
deltaTimeTime elapsed since the previous update (seconds).
Returns
true when the Tween has finished, false while it is running.

Implemented in lysa::TweenSequence::update(), lysa::PropertyTween::update()

Member Data Documentation

Callback callback
protected
TransitionType interpolationType
protected
bool running {false}
protected