ElectricNightOwl / ArmSwinger

ArmSwinger is an artificial VR locomotion library developed on Unity 5.4. ArmSwinger allows you to use your arms to control your position in 3D space in a natural way with minimal disorientation.
http://electricnightowl.com/armswinger/
MIT License
101 stars 30 forks source link

Allow non-linear inertia curves #19

Open kjack9 opened 7 years ago

kjack9 commented 7 years ago

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 commented 6 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!