|
Zappy GUI
C++ graphic client: renderer, camera, network
|
Interpolates an entity's visual angle from one value to another over a specified duration. More...
#include <TurnBehavior.hpp>
Inheritance diagram for TurnBehavior:
Collaboration diagram for TurnBehavior:Public Member Functions | |
| TurnBehavior (VisualState &visual, float fromAngle, float toAngle, float duration) | |
| void | update (float dt) override |
| bool | isDone () const override |
| Returns true when the behavior has completed and can be removed. | |
| float | getDuration () const override |
| Total duration of this behavior in seconds. | |
| float | minDuration () const override |
| Minimum duration below which this behavior is skipped entirely. | |
Public Member Functions inherited from IBehavior | |
| virtual | ~IBehavior ()=default |
Static Private Member Functions | |
| static float | _smoothstep (float t) |
Private Attributes | |
| VisualState & | _visual |
| float | _fromAngle |
| float | _delta |
| float | _duration |
| float | _elapsed = 0.0f |
Interpolates an entity's visual angle from one value to another over a specified duration.
Definition at line 9 of file TurnBehavior.hpp.
| TurnBehavior::TurnBehavior | ( | VisualState & | visual, |
| float | fromAngle, | ||
| float | toAngle, | ||
| float | duration | ||
| ) |
Definition at line 5 of file TurnBehavior.cpp.
References _delta, _fromAngle, and toAngle().
Here is the call graph for this function:
|
staticprivate |
s(t) = t²(3 - 2t) — ease-in/ease-out, zero derivative at t=0 and t=1
Definition at line 26 of file TurnBehavior.cpp.
Referenced by update().
Here is the caller graph for this function:
|
inlineoverridevirtual |
Total duration of this behavior in seconds.
Implements IBehavior.
Definition at line 15 of file TurnBehavior.hpp.
References _duration.
|
overridevirtual |
Returns true when the behavior has completed and can be removed.
Implements IBehavior.
Definition at line 23 of file TurnBehavior.cpp.
|
inlineoverridevirtual |
Minimum duration below which this behavior is skipped entirely.
Implements IBehavior.
Definition at line 16 of file TurnBehavior.hpp.
|
overridevirtual |
Implements IBehavior.
Definition at line 15 of file TurnBehavior.cpp.
References _delta, _duration, _elapsed, _fromAngle, _smoothstep(), _visual, and VisualState::angle.
Here is the call graph for this function:
|
private |
Definition at line 21 of file TurnBehavior.hpp.
Referenced by TurnBehavior(), and update().
|
private |
Definition at line 22 of file TurnBehavior.hpp.
Referenced by getDuration(), isDone(), and update().
|
private |
Definition at line 23 of file TurnBehavior.hpp.
|
private |
Definition at line 20 of file TurnBehavior.hpp.
Referenced by TurnBehavior(), and update().
|
private |
Definition at line 19 of file TurnBehavior.hpp.
Referenced by update().