SergeyMakeev / ArcadeCarPhysics

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

Brute force reverse curve evaluation is not accurate with longer curves. #5

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.

llapresi commented 4 years ago

closing issue after creating pull request. see https://github.com/SergeyMakeev/ArcadeCarPhysics/pull/6