|
Zappy GUI
C++ graphic client: renderer, camera, network
|
Expanding ring wave emitted from a broadcasting player, implemented as a circle of particles. More...
#include <BroadcastBehavior.hpp>
Inheritance diagram for BroadcastBehavior:
Collaboration diagram for BroadcastBehavior:Classes | |
| struct | ScatterSeed |
Public Member Functions | |
| BroadcastBehavior (VisualState &visual, float server_tick_rate, float maxRadius, float mapWidth, float mapHeight) | |
| 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 ADrawableBehavior | |
| const std::vector< Particle > & | getParticles () const |
| const std::vector< LineSegment > & | getLines () const |
Public Member Functions inherited from IBehavior | |
| virtual | ~IBehavior ()=default |
Static Public Attributes | |
| static constexpr int | RING_POINTS = 64 |
Private Attributes | |
| VisualState & | _visual |
| float | _duration |
| float | _elapsed = 0.0f |
| float | _maxRadius |
| float | _halfW |
| float | _halfH |
| std::vector< ScatterSeed > | _seeds |
Static Private Attributes | |
| static constexpr int | SCATTER_COUNT = 30 |
Additional Inherited Members | |
Protected Attributes inherited from ADrawableBehavior | |
| std::vector< Particle > | _particles |
| std::vector< LineSegment > | _lines |
Expanding ring wave emitted from a broadcasting player, implemented as a circle of particles.
Definition at line 12 of file BroadcastBehavior.hpp.
| BroadcastBehavior::BroadcastBehavior | ( | VisualState & | visual, |
| float | server_tick_rate, | ||
| float | maxRadius, | ||
| float | mapWidth, | ||
| float | mapHeight | ||
| ) |
Definition at line 12 of file BroadcastBehavior.cpp.
References ADrawableBehavior::_lines, ADrawableBehavior::_particles, _seeds, frand(), JITTER_RANGE, RING_POINTS, and SCATTER_COUNT.
Here is the call graph for this function:
|
inlineoverridevirtual |
Total duration of this behavior in seconds.
Implements IBehavior.
Definition at line 21 of file BroadcastBehavior.hpp.
References _duration.
|
overridevirtual |
Returns true when the behavior has completed and can be removed.
Implements IBehavior.
Definition at line 92 of file BroadcastBehavior.cpp.
References _duration, _elapsed, ADrawableBehavior::_lines, and ADrawableBehavior::_particles.
|
inlineoverridevirtual |
Minimum duration below which this behavior is skipped entirely.
Implements IBehavior.
Definition at line 22 of file BroadcastBehavior.hpp.
|
overridevirtual |
Implements IBehavior.
Definition at line 55 of file BroadcastBehavior.cpp.
References _duration, _elapsed, _halfH, _halfW, ADrawableBehavior::_lines, _maxRadius, ADrawableBehavior::_particles, _seeds, _visual, BroadcastBehavior::ScatterSeed::alphaScale, BroadcastBehavior::ScatterSeed::angleOffset, frand(), VisualState::pos, BroadcastBehavior::ScatterSeed::radialJitter, RING_POINTS, RING_Y, SCATTER_COUNT, and wrapCoord().
Here is the call graph for this function:
|
private |
Definition at line 34 of file BroadcastBehavior.hpp.
Referenced by getDuration(), isDone(), and update().
|
private |
Definition at line 35 of file BroadcastBehavior.hpp.
|
private |
Definition at line 38 of file BroadcastBehavior.hpp.
Referenced by update().
|
private |
Definition at line 37 of file BroadcastBehavior.hpp.
Referenced by update().
|
private |
Definition at line 36 of file BroadcastBehavior.hpp.
Referenced by update().
|
private |
Definition at line 39 of file BroadcastBehavior.hpp.
Referenced by BroadcastBehavior(), and update().
|
private |
Definition at line 33 of file BroadcastBehavior.hpp.
Referenced by update().
|
staticconstexpr |
Definition at line 14 of file BroadcastBehavior.hpp.
Referenced by BroadcastBehavior(), and update().
|
staticconstexprprivate |
Definition at line 41 of file BroadcastBehavior.hpp.
Referenced by BroadcastBehavior(), and update().