FastLED 3.9.15
|
Catmull–Rom spline through arbitrary points.
Simply add control points and compute(α) will smoothly interpolate through them.
Definition at line 245 of file xypath_impls.h.
#include <xypath_impls.h>
Public Member Functions | |
CatmullRomPath (const fl::shared_ptr< CatmullRomParams > &p=fl::make_shared< CatmullRomParams >()) | |
void | addPoint (float x, float y) |
Add a point with separate x,y coordinates. | |
void | addPoint (vec2f p) |
Add a point in [0,1]² to the path. | |
void | clear () |
Clear all control points. | |
vec2f | compute (float alpha) override |
const string | name () const override |
CatmullRomParams & | params () |
const CatmullRomParams & | params () const |
fl::size | size () const |
Get the number of control points. | |
![]() | |
virtual | ~XYPathGenerator ()=default |
virtual bool | hasDrawBounds (rect< i16 > *bounds) |
Private Member Functions | |
vec2f | interpolate (const vec2f &p0, const vec2f &p1, const vec2f &p2, const vec2f &p3, float t) const |
Private Attributes | |
fl::shared_ptr< CatmullRomParams > | mParams |