![]() |
Lysa
0.0
Lysa 3D Engine
|
Tween that interpolates a property of an Object via a setter function.
The template parameter T is the property value type (e.g., float, float3). Each update computes the interpolated value and calls the provided setter on the target object. When the duration elapses, the Tween stops and the optional completion callback is invoked.
Inheritance diagram for PropertyTween< T >:Public Member Functions | |
| template<typename O > | |
| PropertyTween (O *obj, void (O::*set)(const T &), T initial, T final, const float duration, const TransitionType ttype=TransitionType::LINEAR, const Callback &callback=nullptr) | |
| bool | update (const double deltaTime) override |
| double | getOverflow () const override |
Public Member Functions inherited from Tween | |
| virtual bool | isRunning () const |
| virtual void | kill () |
| virtual | ~Tween () = default |
Additional Inherited Members | |
Public Typedefs inherited from Tween | |
| using | Callback = std::function< void ()> |
Protected Member Functions inherited from Tween | |
| Tween (const TransitionType type, const Callback &callback) | |
Static Protected Member Functions inherited from Tween | |
| static double | applyEase (TransitionType type, double t) |
Protected Attributes inherited from Tween | |
| bool | running {false} |
| Callback | callback |
| TransitionType | interpolationType |
|
inline |
Creates a Tween that interpolates a property on an Object. The target object must outlive the Tween.
| obj | The target object. |
| set | Member setter to call on the target object. |
| initial | Starting value applied at time 0. |
| final | Target value reached at the end of the duration. |
| duration | Animation duration in seconds (must be > 0). |
| ttype | Interpolation curve to use (default: LINEAR). |
| callback | Optional function invoked when the Tween completes. |
|
inlineoverridevirtual |
Returns the time that overflowed past the end of this Tween (>= 0).
Reimplemented from lysa::Tween::getOverflow()
|
inlineoverridevirtual |
Advances the Tween by delta time.
| deltaTime | Time elapsed since the previous update (seconds). |
Implements lysa::Tween::update()