Open kjack9 opened 7 years ago
Love this library! I think I know a way to implement this. Basically, pair each movement curve with an inverted curve that you can use to lookup the time based on the speed.
If the linear curve is y=mx+b
, then the inverse is x =(y-b)/m
. You can do this pretty simply using the AnimationCurve keyframe setters and paying attention to the tangents. I'll try to get some code in when I have the chance. Great work on this, it's been a very helpful library!
Currently, the moving and stopping inertia curves are forced to linear. This is so that we can determine where in the curve the calculation should start based on the last speed. Custom curves should be supported.