mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-08-08 07:09:52 +00:00
Initial implementation of bspline support in the animation editor
This commit is contained in:
parent
4c52a147b0
commit
575a83abd6
10 changed files with 515 additions and 120 deletions
|
@ -19,6 +19,7 @@ public:
|
|||
SplineGridCtrlPoint();
|
||||
virtual void onUpdate(float dt) OVERRIDE;
|
||||
Vector getSplinePosition() const;
|
||||
void setSplinePosition(Vector pos);
|
||||
|
||||
static SplineGridCtrlPoint *movingPoint;
|
||||
};
|
||||
|
@ -32,21 +33,28 @@ public:
|
|||
~SplineGrid();
|
||||
|
||||
// # of control points on each axis
|
||||
void resize(size_t w, size_t h, size_t xres, size_t yres, unsigned deg);
|
||||
void resize(size_t w, size_t h, size_t xres, size_t yres, unsigned degx, unsigned degy);
|
||||
void recalc();
|
||||
|
||||
void exportControlPoints(Vector *controlpoints);
|
||||
void importControlPoints(const Vector *controlpoints);
|
||||
void resetControlPoints();
|
||||
|
||||
|
||||
virtual void onRender(const RenderState& rs) const OVERRIDE;
|
||||
virtual void onUpdate(float dt) OVERRIDE;
|
||||
|
||||
BSpline2D& getSpline() { return bsp; }
|
||||
const BSpline2D& getSpline() const { return bsp; }
|
||||
|
||||
bool wasModified; // to be checked/reset by external code
|
||||
|
||||
private:
|
||||
|
||||
SplineGridCtrlPoint *createControlPoint(size_t x, size_t y);
|
||||
|
||||
std::vector<SplineGridCtrlPoint*> ctrlp;
|
||||
unsigned deg;
|
||||
BSpline2D bsp;
|
||||
BSpline2DWithPoints bsp;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue