Skip to content

Commit 63cc2da

Browse files
committed
Automatic merge of T1.5.1-797-gabb8eb9a4 and 13 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at a055bca: Blueprint/train car operations UI window - Pull request #885 at 8f94333: feat: Add notifications to Menu - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 0a9d939: feat: Improved system information collection - Pull request #899 at 628a9fb: Duplex steam engines - Booster Engine addition - Pull request #907 at 9b0b04f: Bug fix for https://bugs.launchpad.net/or/+bug/2047300 Dynamic tracks disappear after long tunnel - Pull request #908 at 4b4afe3: feat: supports switching adhesion precisions - Pull request #909 at c3a572a: Correct Control Car crash bug
15 parents 423c4f1 + abb8eb9 + 3539862 + d00beb9 + f92de76 + a055bca + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 0a9d939 + 628a9fb + 9b0b04f + 4b4afe3 + c3a572a commit 63cc2da

File tree

3 files changed

+43
-4
lines changed

3 files changed

+43
-4
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSDieselLocomotive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float t,
760760
DieselEngines.HandleEvent(PowerSupplyEvent.StopEngine);
761761
}
762762

763-
ApplyDirectionToTractiveForce(ref TractiveForceN);
763+
ApplyDirectionToTractiveForce(ref TractiveForceN, 0);
764764

765765
// Calculate the total tractive force for the locomotive - ie Traction + Dynamic Braking force.
766766
// Note typically only one of the above will only ever be non-zero at the one time.

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,7 +2401,7 @@ protected virtual void UpdateTractiveForce(float elapsedClockSeconds, float t, f
24012401
AverageForceN = w * AverageForceN + (1 - w) * TractiveForceN;
24022402
}
24032403

2404-
ApplyDirectionToTractiveForce(ref TractiveForceN);
2404+
ApplyDirectionToTractiveForce(ref TractiveForceN, 0);
24052405

24062406
// Calculate the total tractive force for the locomotive - ie Traction + Dynamic Braking force.
24072407
// Note typically only one of the above will only ever be non-zero at the one time.
@@ -2456,7 +2456,7 @@ protected virtual void UpdateAxleDriveForce()
24562456
/// <summary>
24572457
/// This function applies a sign to the motive force as a function of the direction of the train.
24582458
/// </summary>
2459-
protected virtual void ApplyDirectionToTractiveForce(ref float tractiveForceN)
2459+
protected virtual void ApplyDirectionToTractiveForce(ref float tractiveForceN, int numberofengine )
24602460
{
24612461
if (Train.IsPlayerDriven)
24622462
{

Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6059,7 +6059,7 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float loc
60596059
// Update tractive effort across all steam engines
60606060
for (int i = 0; i < SteamEngines.Count; i++)
60616061
{
6062-
ApplyDirectionToTractiveForce(ref SteamEngines[i].TractiveForceN);
6062+
ApplyDirectionToTractiveForce(ref SteamEngines[i].TractiveForceN, i);
60636063

60646064
TractiveForceN += SteamEngines[i].TractiveForceN;
60656065

@@ -6122,6 +6122,45 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float loc
61226122
}
61236123

61246124

6125+
/// <summary>
6126+
/// This function applies a sign to the motive force as a function of the direction of the train.
6127+
/// </summary>
6128+
protected override void ApplyDirectionToTractiveForce(ref float tractiveForceN, int numberofengine)
6129+
{
6130+
if (Train.IsPlayerDriven)
6131+
{
6132+
// If booster engine tractive force will only ever be in the forward (+ve) direction
6133+
if (SteamEngines[numberofengine].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster)
6134+
return;
6135+
6136+
switch (Direction)
6137+
{
6138+
case Direction.Forward:
6139+
//tractiveForceN *= 1; //Not necessary
6140+
break;
6141+
case Direction.Reverse:
6142+
tractiveForceN *= -1;
6143+
break;
6144+
case Direction.N:
6145+
default:
6146+
tractiveForceN *= 0;
6147+
break;
6148+
}
6149+
}
6150+
else // for AI locomotives
6151+
{
6152+
switch (Direction)
6153+
{
6154+
case Direction.Reverse:
6155+
tractiveForceN *= -1;
6156+
break;
6157+
default:
6158+
break;
6159+
}
6160+
}// end AI locomotive
6161+
}
6162+
6163+
61256164
/// <summary>
61266165
/// Normalise booster engine crank angle so that it is a value between 0 and 360 starting at the real crank angle difference
61276166
/// </summary>

0 commit comments

Comments
 (0)