We do a binary search on the distance curve. We have several assumptions:
- a key per frame of animation.
- linear interpolation in between keys, just like animation.
- distance curve values are in increasing order.
- we don’t have duplicate values, except for the stop transition when it reaches zero.