Skip to content

Commit 1168d61

Browse files
committed
Restore original brake calculations
1 parent 4447c8d commit 1168d61

File tree

1 file changed

+6
-0
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks

1 file changed

+6
-0
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3259,6 +3259,9 @@ public virtual float GetBrakeShoeFrictionFactor()
32593259
float zeroUserFriction = BrakeShoeFrictionFactor[MpS.ToKpH(0)];
32603260

32613261
frictionfraction = userFriction / zeroUserFriction * AdhesionMultiplier; // Factor calculated by normalising zero speed value on friction curve applied in WAG file
3262+
3263+
// Clamp adjustment factor to a value of 1.0 - i.e. the brakeforce can never exceed the Brake Force value defined in the WAG file
3264+
frictionfraction = MathHelper.Clamp(frictionfraction, 0.01f, 1.0f);
32623265
}
32633266
else
32643267
{
@@ -3268,6 +3271,9 @@ public virtual float GetBrakeShoeFrictionFactor()
32683271
// Assuming that current MaxBrakeForce has been set with an existing Friction CoF of 0.2f, an adjustment factor needs to be developed to reduce
32693272
// the MAxBrakeForce by a relative amount. Note force will be higher then ENG file value at low speed and reduce to actual value at higher speeds.
32703273
frictionfraction = defaultBrakeShoeCoefficientFriction / 0.2f * AdhesionMultiplier; // Assuming that current MaxBrakeForce has been set with an existing Friction CoF of 0.2f, an adjustment factor needs to be developed to reduce the MAxBrakeForce by a relative amount
3274+
3275+
// Clamp adjustment factor to a value of 1.0 - i.e. the brakeforce can never exceed the Brake Force value defined in the WAG file
3276+
frictionfraction = MathHelper.Clamp(frictionfraction, 0.01f, 1.0f);
32713277
}
32723278
}
32733279

0 commit comments

Comments
 (0)