animation_curve_nearest_point
animation_curve_nearest_point(curve, ref_time, ref_value) ⇒ number
NOTE: this operation has O(n) complexity, where n is the number of keys in the curve.
Kind: global function
Returns: number - time of the nearest point on the curve
See: AnimationCurve
| Param | Type |
|---|---|
| curve | AnimationCurve |
| ref_time | number |
| ref_value | number |
Example
const nearest_time = animation_curve_nearest_point(curve, 0.5, 10);
const nearest_value = curve.evaluate(nearest_time);