Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-linear inertia curves #19

Open
kjack9 opened this issue Aug 5, 2016 · 1 comment
Open

Allow non-linear inertia curves #19

kjack9 opened this issue Aug 5, 2016 · 1 comment

Comments

@kjack9
Copy link
Member

kjack9 commented Aug 5, 2016

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.

@efruchter
Copy link

efruchter commented Oct 16, 2017

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants