SergeyMakeev / ArcadeCarPhysics

Arcade Car Physics - Vehicle Simulation for Unity3D
MIT License
390 stars 80 forks source link

Upgraded project to 2018.4.15f1 LTS and Replaced linear brute force reverse curve evaluation with binary search #6

Closed llapresi closed 4 years ago

llapresi commented 4 years ago

Acceleration curves with a longer length that the default 10 second curve tend to be inaccurate, with acceleration faster than described in the curve.

Increasing the number of iterations of the brute force reverse curve evaluation does solve this problem but I have created a fork and associated pull-request replacing it with a binary search. This changes time complexity to O(log n) rather than O(n), honing in on the correct value in less iterations while allowing for performance tuning by the user.

SergeyMakeev commented 4 years ago

Awesome! Thank you for the contribution!

llapresi commented 4 years ago

Your welcome