I created a new branch to work on this. There are a lot of things to do! But it kind of works (https://github.com/gsenna/cabbage/tree/feature-quadbezier).
Some issues and other things to do:
- SetWaveform() takes an Array of floats to determine MinMax. This won’t work because a CtrlPoint could have a higher y-value. This is the case of my test file inside Build/Linux. Should we overload that function specially for Quadbezier?
- You were not getting the correct values mainly because normalised was > 0. I just removed the conditional. Do we need that? quadbezier tables are not supposed to be rescaled anyway.
- We may need a way to set the Colour for Control Handles (I set them to blue in my fork). It would be nice to have dotted lines that connect these handles with the regular ones. Every graphic editor that implements bezier curves seems to do this.
- It would be nice to be able to change the colour of the CtrlPoint handle to some other colour when you create a straight line between two regular Handles. This way quadbezier=gen05+gen07.
- Adding and deleting handles with the mouse doesn’t work.
There was another thing but I can’t remember what it was. Anyway, it is very rewarding to see this (almost) working. I can’t believe that trick with the quadratic equation works. lol.