![]() |
Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
|
An activity for a change of angle. More...
#include <gf/Activities.h>

Public Member Functions | |
| RotateToActivity (float origin, float target, float &angle, Time duration, Easing easing=Ease::linear) | |
| Constructor. More... | |
| void | setOrigin (float origin) |
| Change the origin of the activity. More... | |
| float | getOrigin () const noexcept |
| Get the origin of the activity. More... | |
| void | setTarget (float target) |
| Change the target of the activity. More... | |
| float | getTarget () const noexcept |
| Get the target of the activity. More... | |
| void | setDuration (Time duration) |
| Change the duration of the activity. More... | |
| Time | getDuration () const noexcept |
| Get the duration of the activity. More... | |
| ActivityStatus | run (Time time) override |
| Run the activity. More... | |
| void | restart () override |
| Restart the activity. More... | |
Public Member Functions inherited from gf::Activity | |
| virtual | ~Activity () |
| Destructor. More... | |
| virtual ActivityStatus | run (Time time)=0 |
| Run the activity. More... | |
| virtual void | restart () |
| Restart the activity. More... | |
An activity for a change of angle.
The activity ensures that the change is no more that \( \pi \) radians.
| gf::RotateToActivity::RotateToActivity | ( | float | origin, |
| float | target, | ||
| float & | angle, | ||
| Time | duration, | ||
| Easing | easing = Ease::linear |
||
| ) |
Constructor.
| origin | The origin value |
| target | The target value |
| angle | A reference on the value |
| duration | The duration of the tween |
| easing | The easing for the interpolation |
|
inlinenoexcept |
Get the duration of the activity.
|
inlinenoexcept |
Get the origin of the activity.
|
inlinenoexcept |
Get the target of the activity.
|
overridevirtual |
Restart the activity.
Reimplemented from gf::Activity.
|
overridevirtual |
Run the activity.
| time | The time since the last run |
Implements gf::Activity.
|
inline |
Change the duration of the activity.
| duration | The new duration |
|
inline |
Change the origin of the activity.
| origin | The new origin |
|
inline |
Change the target of the activity.
| target | The new target |