Monotone Piecewise Cubic Interpolation
| 215 | |
| 216 | // Monotone Piecewise Cubic Interpolation |
| 217 | inline int TriSign(float x, float eps = 1e-6f) |
| 218 | { |
| 219 | if (x < -eps) |
| 220 | return -1; |
| 221 | if (x > +eps) |
| 222 | return +1; |
| 223 | |
| 224 | return 0; |
| 225 | } |
| 226 | |
| 227 | // Given dv = Bezier delta from corresponding adjacent endpoint, and the |
| 228 | // corresponding end and hull values, return a clamped version of dv that avoids overshoots |