If the magnitude of `x` if less than epsilon, return 0. */
| 143 | |
| 144 | /** If the magnitude of `x` if less than epsilon, return 0. */ |
| 145 | inline float chop(float x, float epsilon = 1e-6f) { |
| 146 | return std::fabs(x) <= epsilon ? 0.f : x; |
| 147 | } |
| 148 | |
| 149 | /** Rescales `x` from the range `[xMin, xMax]` to `[yMin, yMax]`. |
| 150 | */ |