Skip to content

Commit 1ec45b9

Browse files
authored
Merge pull request #858 from cesarBLG/multiple-axles-visuals
Fix wheel animation problems
2 parents 2f57132 + bbaeeba commit 1ec45b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,6 +2018,7 @@ public override void Update(float elapsedClockSeconds)
20182018

20192019
AntiSlip = true; // Always set AI trains to AntiSlip
20202020
SimpleAdhesion(); // Simple adhesion model used for AI trains
2021+
AdvancedAdhesionModel = false;
20212022
if (Train.IsActualPlayerTrain) FilteredMotiveForceN = CurrentFilter.Filter(MotiveForceN, elapsedClockSeconds);
20222023
WheelSpeedMpS = Flipped ? -AbsSpeedMpS : AbsSpeedMpS; //make the wheels go round
20232024
break;

Source/RunActivity/Viewer3D/RollingStock/MSTSWagonViewer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,9 +726,8 @@ private void UpdateAnimation(RenderFrame frame, ElapsedTime elapsedTime)
726726
float AnimationWheelRadiusM = MSTSWagon.WheelRadiusM; // Radius of non driven wheels
727727
float AnimationDriveWheelRadiusM = MSTSWagon.DriverWheelRadiusM; // Radius of driven wheels
728728

729-
if (MSTSWagon.IsDriveable && MSTSWagon.Simulator.UseAdvancedAdhesion && !MSTSWagon.Simulator.Settings.SimpleControlPhysics)
729+
if (MSTSWagon is MSTSLocomotive loco && loco.AdvancedAdhesionModel)
730730
{
731-
var loco = MSTSWagon as MSTSLocomotive;
732731
//TODO: next code line has been modified to flip trainset physics in order to get viewing direction coincident with loco direction when using rear cab.
733732
// To achieve the same result with other means, without flipping trainset physics, the line should be changed as follows:
734733
// distanceTravelledM = MSTSWagon.WheelSpeedMpS * elapsedTime.ClockSeconds;

0 commit comments

Comments
 (0)