Provides static utility functions for mathematical operations related to the Blob animation.
More...
|
| static QPointF | CalculateBezierControlPoint (const QPointF &p0, const QPointF &p1, const QPointF &p2, float tension) |
| | Calculates a control point for a cubic Bezier segment, often used in Catmull-Rom splines. This helps create smooth curves that pass through a series of points (p0, p1, p2, ...). The calculated point is a control point associated with the segment passing through p1.
|
| |
template<typename T>
requires std::totally_ordered<T> |
| static T | Clamp (const T &value, const T &min, const T &max) |
| | Clamps a value between a minimum and maximum limit. Requires the type T to be totally ordered (support <, >, <=, >=, ==, !=). Uses Qt's qBound internally.
|
| |
| static std::vector< QPointF > | GenerateCircularPoints (const QPointF ¢er, double radius, int num_of_points) |
| | Generates a specified number of points approximately distributed on a circle. Introduces slight randomness to the radius of each point for a more organic look.
|
| |
| static bool | IsValidPoint (const QPointF &point) |
| | Checks if a QPointF contains valid coordinate values. Verifies that coordinates are not NaN, infinite, or excessively large.
|
| |
Provides static utility functions for mathematical operations related to the Blob animation.
This class contains helper functions for tasks such as validating points, clamping values, generating points on a circle, and calculating Bezier control points (potentially for path smoothing).
template<typename T>
requires std::totally_ordered<T>
| static T BlobMath::Clamp |
( |
const T & | value, |
|
|
const T & | min, |
|
|
const T & | max ) |
|
inlinestatic |
Clamps a value between a minimum and maximum limit. Requires the type T to be totally ordered (support <, >, <=, >=, ==, !=). Uses Qt's qBound internally.
- Template Parameters
-
| T | The type of the value to clamp. Must satisfy std::totally_ordered. |
- Parameters
-
| value | The value to clamp. |
| min | The minimum allowed value. |
| max | The maximum allowed value. |
- Returns
- The clamped value, guaranteed to be within [min, max].