Skip to content

Commit 08b015b

Browse files
committed
Automatic merge of T1.5.1-1705-g95e36ea99 and 17 pull requests
- Pull request #570 at f11a428: glTF 2.0 support with PBR lighting - Pull request #900 at 4629736: DMI in 3D cab + two more dials - Pull request #1030 at d3ae4a2: Refactor settings, in prep for settings exporter - Pull request #1045 at cc4d53c: Bugfix: Empty Start Time for Explore, and other issues loading from Menu Selection and Content Routes - Pull request #1052 at 3b5cb90: Content Manager: Add axle count, and lowest derail force - Pull request #1062 at b96d6fa: Train Forces popup Window. - Pull request #1064 at 52410f9: Add Train Info tab to Help window (F1) - Pull request #1066 at 62c89c1: Log derailment, using TraceInformation. - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #1000 at d8d9709: Locomotive operation from control car - Pull request #1049 at 6a0c471: Re-organise document storage and access - Pull request #1057 at 254b6d4: Switchable brake system - Pull request #1069 at 3f153f0: Mouse wheel control only with Alt – Followup for #1051 - Pull request #1070 at f818e40: Fix a NullReferenceException in TCS scripts - Pull request #1071 at 722dd3f: Change cover image for v1.6 - Pull request #1074 at e9a66c1: Gradient - commit 2024-16-12 - Pull request #1055 at 5c78967: Route Based TTrack Sounds
19 parents 3b85185 + 95e36ea + f11a428 + 4629736 + d3ae4a2 + cc4d53c + 3b5cb90 + b96d6fa + 52410f9 + 62c89c1 + 1f5ba4c + d8d9709 + 6a0c471 + 254b6d4 + 3f153f0 + f818e40 + 722dd3f + e9a66c1 + 5c78967 commit 08b015b

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

Source/Orts.Simulation/Simulation/Simulator.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -778,10 +778,10 @@ public TrainCar SetPlayerLocomotive(Train playerTrain)
778778
{
779779
if (!leadFound)
780780
{
781-
PlayerLocomotive = car;
782-
playerTrain.LeadLocomotive = car;
783-
playerTrain.InitializeBrakes();
784-
PlayerLocomotive.LocalThrottlePercent = playerTrain.AITrainThrottlePercent;
781+
PlayerLocomotive = car;
782+
playerTrain.LeadLocomotive = car;
783+
playerTrain.InitializeBrakes();
784+
PlayerLocomotive.LocalThrottlePercent = playerTrain.AITrainThrottlePercent;
785785
PlayerLocomotive.SignalEvent(Event.PlayerTrainLeadLoco);
786786
leadFound = true;
787787
}

Source/RunActivity/Viewer3D/RollingStock/MSTSWagonViewer.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
793793
car.SoundHeardInternallyCorrection[MSTSWagon.LeftWindowFrontIndex] = LeftWindowFront.AnimationKeyFraction();
794794
if (RightWindowFront.MaxFrame > 0)
795795
car.SoundHeardInternallyCorrection[MSTSWagon.RightWindowFrontIndex] = RightWindowFront.AnimationKeyFraction();
796-
}
796+
}
797797
}
798798

799799

@@ -814,18 +814,18 @@ private void UpdateAnimation(RenderFrame frame, ElapsedTime elapsedTime)
814814
foreach (var kvp in RunningGears)
815815
{
816816
if (!kvp.Value.Empty())
817-
{
817+
{
818818
var axle = kvp.Key >= 0 && kvp.Key < loco.LocomotiveAxles.Count ? loco.LocomotiveAxles[kvp.Key] : null;
819819
if (axle != null)
820820
//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.
821821
kvp.Value.UpdateLoop(((MSTSWagon.Train != null && MSTSWagon.Train.IsPlayerDriven && loco.UsingRearCab) ? -1 : 1) * (float)axle.AxleSpeedMpS * elapsedTime.ClockSeconds / MathHelper.TwoPi / axle.WheelRadiusM);
822822
else if (AnimationDriveWheelRadiusM > 0.001)
823823
kvp.Value.UpdateLoop(distanceTravelledM / MathHelper.TwoPi / AnimationDriveWheelRadiusM);
824-
}
824+
}
825825

826-
}
826+
}
827827
foreach (var kvp in WheelPartIndexes)
828-
{
828+
{
829829
var axle = kvp.Key < loco.LocomotiveAxles.Count && kvp.Key >= 0 ? loco.LocomotiveAxles[kvp.Key] : (Car.EngineType == TrainCar.EngineTypes.Steam ? null : loco.LocomotiveAxles[0]);
830830
Matrix wheelRotationMatrix;
831831
if (axle != null)
@@ -840,33 +840,33 @@ private void UpdateAnimation(RenderFrame frame, ElapsedTime elapsedTime)
840840
wheelRotationMatrix = Matrix.CreateRotationX(WheelRotationR);
841841
}
842842
foreach (var iMatrix in kvp.Value)
843-
{
843+
{
844844
TrainCarShape.XNAMatrices[iMatrix] = wheelRotationMatrix * TrainCarShape.SharedShape.Matrices[iMatrix];
845-
}
845+
}
846846
}
847847
}
848848
else // set values for simple adhesion
849-
{
849+
{
850850
distanceTravelledM = ((MSTSWagon.IsDriveable && MSTSWagon.Train != null && MSTSWagon.Train.IsPlayerDriven && ((MSTSLocomotive)MSTSWagon).UsingRearCab) ? -1 : 1) * MSTSWagon.SpeedMpS * elapsedTime.ClockSeconds;
851851
if (Car.BrakeSkid) distanceTravelledM = 0;
852852
foreach (var kvp in RunningGears)
853853
{
854854
if (!kvp.Value.Empty() && AnimationDriveWheelRadiusM > 0.001)
855855
kvp.Value.UpdateLoop(distanceTravelledM / MathHelper.TwoPi / AnimationDriveWheelRadiusM);
856856
}
857-
// Wheel rotation (animation) - for non-drive wheels in steam locomotives and all wheels in other stock
858-
if (WheelPartIndexes.Count > 0)
859-
{
857+
// Wheel rotation (animation) - for non-drive wheels in steam locomotives and all wheels in other stock
858+
if (WheelPartIndexes.Count > 0)
859+
{
860860
var rotationalDistanceR = distanceTravelledM / AnimationWheelRadiusM; // in radians
861-
WheelRotationR = MathHelper.WrapAngle(WheelRotationR - rotationalDistanceR);
862-
var wheelRotationMatrix = Matrix.CreateRotationX(WheelRotationR);
861+
WheelRotationR = MathHelper.WrapAngle(WheelRotationR - rotationalDistanceR);
862+
var wheelRotationMatrix = Matrix.CreateRotationX(WheelRotationR);
863863
foreach (var kvp in WheelPartIndexes)
864-
{
864+
{
865865
foreach (var iMatrix in kvp.Value)
866866
{
867-
TrainCarShape.XNAMatrices[iMatrix] = wheelRotationMatrix * TrainCarShape.SharedShape.Matrices[iMatrix];
868-
}
869-
}
867+
TrainCarShape.XNAMatrices[iMatrix] = wheelRotationMatrix * TrainCarShape.SharedShape.Matrices[iMatrix];
868+
}
869+
}
870870
}
871871
}
872872

0 commit comments

Comments
 (0)