ricardojmendez / UnitySteer

Steering, obstacle avoidance and path following behaviors for the Unity Game Engine
https://numergent.com/tags/unitysteer/
Other
1.21k stars 277 forks source link

Velocity being smoothed on calculation, not on application #19

Closed ricardojmendez closed 11 years ago

ricardojmendez commented 11 years ago

Commit 485e3f3 introduced a change where we split the calculation of a vehicle's velocity from its speed.

While the vehicles still applied acceleration smoothing, they applied it to the result of the force calculation. However, force calculations don't necessarily take place every frame, whereas force application does. It would make more sense - and yield smoother behavior - to perform this force smoothing on when the force is applied to the vehicle, since otherwise the speed being applied still changes in steps based on the last calculation.

ricardojmendez commented 11 years ago

Implemented.

https://github.com/ricardojmendez/UnitySteer/commit/485150d5bd87874d9d8eaed4d9464544dd922ac5