|
Wavelength
Privacy-focused, cross-platform, and open-source communication application
|
Abstract base class defining the interface for different blob animation states. More...
#include <blob_state.h>
Public Member Functions | |
| virtual void | Apply (std::vector< QPointF > &control_points, std::vector< QPointF > &velocity, QPointF &blob_center, const BlobConfig::BlobParameters ¶ms)=0 |
| Applies the state-specific logic and effects to the blob. This method is called periodically by the animation loop to update the blob's appearance or behavior based on the current state (e.g., applying idle wave effect). | |
| virtual void | ApplyForce (const QVector2D &force, std::vector< QPointF > &velocity, QPointF &blob_center, const std::vector< QPointF > &control_points, double blob_radius)=0 |
| Applies an external force to the blob, potentially modified by the current state. Allows states to react differently to external forces (e.g., inertia from window movement). | |
| virtual | ~BlobState ()=default |
| Virtual destructor. Ensures proper cleanup when deleting derived state objects through a base class pointer. | |
Abstract base class defining the interface for different blob animation states.
This class serves as the foundation for specific state implementations (e.g., Idle, Moving, Resizing). Each derived class must implement the Apply() and ApplyForce() methods to define the behavior and physics modifications specific to that state.
|
virtualdefault |
Virtual destructor. Ensures proper cleanup when deleting derived state objects through a base class pointer.
|
pure virtual |
Applies the state-specific logic and effects to the blob. This method is called periodically by the animation loop to update the blob's appearance or behavior based on the current state (e.g., applying idle wave effect).
| control_points | Reference to the vector of current control point positions (can be modified). |
| velocity | Reference to the vector of current control point velocities (can be modified). |
| blob_center | Reference to the blob's center position (can be modified). |
| params | Blob appearance parameters (read-only). |
Implemented in IdleState, MovingState, and ResizingState.
|
pure virtual |
Applies an external force to the blob, potentially modified by the current state. Allows states to react differently to external forces (e.g., inertia from window movement).
| force | The external force vector to apply. |
| velocity | Reference to the vector of current control point velocities (modified). |
| blob_center | Reference to the blob's center position (modified). |
| control_points | Reference to the vector of current control point positions (read-only, used for calculations). |
| blob_radius | The current average radius of the blob (read-only, used for calculations). |
Implemented in IdleState, MovingState, and ResizingState.