Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 60053889 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

reconsider gear selection during engage

parent b6940c3e
No related branches found
No related tags found
No related merge requests found
......@@ -548,6 +548,15 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Impl
public override uint Engage(Second absTime, Second dt, NewtonMeter outTorque, PerSecond outAngularVelocity)
{
//_nextGear = gear;
while (_nextGear > 1 && SpeedTooLowForEngine(_nextGear, outAngularVelocity)) {
_nextGear--;
}
while (_nextGear < ModelData.Gears.Count &&
SpeedTooHighForEngine(_nextGear, outAngularVelocity)) {
_nextGear++;
}
return _nextGear;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment