k4kfh / ZephyrCab

Drive a model train with prototypical controls, realistic behavior, and simulated physics; uses JMRI's WebSockets interface for layout connection
http://k4kfh.github.io/ZephyrCab
GNU Affero General Public License v3.0
10 stars 4 forks source link

Rolling Resistance for Reverse Operation #4

Closed k4kfh closed 8 years ago

k4kfh commented 8 years ago

Rolling resistance remains negative even when operating in reverse. This should not be; it should change to positive with motive force being negative during reverse operation.

k4kfh commented 8 years ago

The primary issue here was a lack of setting sim.direction. Rolling resistance is multiplied by sim.direction, so if done properly when in reverse that means rolling resistance is multiplied by -1, making it a positive number since a retarding force is already a negative by default.

k4kfh commented 8 years ago

With some testing, I have confirmed that the above commit fixes this issue.