15namespace aui::animation_curves {
23 CubicBezier(glm::vec2 v1, glm::vec2 v2) : v1(v1), v2(v2) {}
25 float operator()(
float t) {
26 float oneMinusX = 1 - t;
27 float oneMinusX2 = oneMinusX * oneMinusX;
28 float oneMinusX3 = oneMinusX2 * oneMinusX;
32 float result = 3 * v1.x * oneMinusX2 * t + 3 * v2.x * oneMinusX * x2 + 2 * x3 +
33 3 * v1.y * oneMinusX2 * t + 3 * v2.y * oneMinusX * x2 - t;