1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-08-08 23:30:06 +00:00

clean up interpolators; WIP towards bspline support in anim editor

This commit is contained in:
fgenesis 2022-09-13 18:38:44 +02:00
parent 55689228bf
commit 29fd4ec44e
9 changed files with 213 additions and 155 deletions

View file

@ -21,3 +21,32 @@ private:
#endif
class BSpline2D
{
public:
BSpline2D();
// # of control points on each axis
void resize(size_t cx, size_t cy, unsigned degx, unsigned degy, float tmin, float tmax);
void recalc(Vector *dst, size_t xres, size_t yres);
std::vector<Vector> controlpoints;
inline Vector& controlpoint(size_t x, size_t y)
{
return controlpoints[y * _cpx + x];
}
inline size_t ctrlX() const { return _cpx; }
inline size_t ctrlY() const { return _cpy; }
inline unsigned degX() const { return _degx; }
inline unsigned degY() const { return _degy; }
private:
size_t _cpx, _cpy; // # of control points
unsigned _degx, _degy;
float _tmin, _tmax;
std::vector<float> knotsX, knotsY;
};