Interpolate two points using the right Point's interpolation method
| 78 | } |
| 79 | // Interpolate two points using the right Point's interpolation method |
| 80 | double InterpolateBetween(Point const & left, Point const & right, double target, double allowed_error) { |
| 81 | // check if target is outside of the extremities poits |
| 82 | // This can occur when moving fast the play head |
| 83 | if(left.co.X > target){ |
| 84 | return left.co.Y; |
| 85 | } |
| 86 | if(target > right.co.X){ |
| 87 | return right.co.Y; |
| 88 | } |
| 89 | switch (right.interpolation) { |
| 90 | case CONSTANT: return left.co.Y; |
| 91 | case LINEAR: return InterpolateLinearCurve(left, right, target); |
| 92 | case BEZIER: return InterpolateBezierCurve(left, right, target, allowed_error); |
| 93 | default: return InterpolateLinearCurve(left, right, target); |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | template<typename Check> |
no test coverage detected