Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 64f2131

Browse files
committed
Automatic merge of T1.5.1-722-g01614a154 and 18 pull requests
- Pull request #570 at 3cba5d6: 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 #865 at 3b5a2fe: Dispatcher window improvements - Pull request #874 at f8dbeab: Dynamic brake controller refactoring - Pull request #875 at 43bf33e: Bug fix for https://bugs.launchpad.net/or/+bug/2036346 Player train switching doesn't work with 3D cabs - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 481ed9d: Blueprint/train car operations UI window - Pull request #885 at c81447b: feat: Add notifications to Menu - Pull request #886 at 697a4b6: Scene viewer extension to TrackViewer - Pull request #888 at d7daf62: docs: Document player application model - Pull request #890 at 39a9fa4: Allow depart early - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #893 at bf8876b: Signal errors - Pull request #894 at 794fddf: Correct Decrease Colour - 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 #898 at e271395: Extra line with all the arguments for debugging purposes in logfile - Pull request #900 at 42ea7ad: DMI updates
20 parents 0d6334e + 01614a1 + 3cba5d6 + d00beb9 + 3b5a2fe + f8dbeab + 43bf33e + f92de76 + 481ed9d + c81447b + 697a4b6 + d7daf62 + 39a9fa4 + 1f5ba4c + bf8876b + 794fddf + 5866028 + 0a9d939 + e271395 + 42ea7ad commit 64f2131

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Source/RunActivity/Viewer3D/RollingStock/MSTSWagonViewer.cs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
753753
car.SoundHeardInternallyCorrection[MSTSWagon.LeftWindowFrontIndex] = LeftWindowFront.AnimationKeyFraction();
754754
if (RightWindowFront.FrameCount > 0)
755755
car.SoundHeardInternallyCorrection[MSTSWagon.RightWindowFrontIndex] = RightWindowFront.AnimationKeyFraction();
756-
}
756+
}
757757
}
758758

759759

@@ -774,18 +774,18 @@ private void UpdateAnimation(RenderFrame frame, ElapsedTime elapsedTime)
774774
foreach (var kvp in RunningGears)
775775
{
776776
if (!kvp.Value.Empty())
777-
{
777+
{
778778
var axle = kvp.Key >= 0 && kvp.Key < loco.LocomotiveAxles.Count ? loco.LocomotiveAxles[kvp.Key] : null;
779779
if (axle != null)
780780
//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.
781781
kvp.Value.UpdateLoop(((MSTSWagon.Train != null && MSTSWagon.Train.IsPlayerDriven && loco.UsingRearCab) ? -1 : 1) * (float)axle.AxleSpeedMpS * elapsedTime.ClockSeconds / MathHelper.TwoPi / axle.WheelRadiusM);
782782
else if (AnimationDriveWheelRadiusM > 0.001)
783783
kvp.Value.UpdateLoop(distanceTravelledM / MathHelper.TwoPi / AnimationDriveWheelRadiusM);
784-
}
785-
786784
}
785+
786+
}
787787
foreach (var kvp in WheelPartIndexes)
788-
{
788+
{
789789
var axle = kvp.Key < loco.LocomotiveAxles.Count && kvp.Key >= 0 ? loco.LocomotiveAxles[kvp.Key] : (Car.EngineType == TrainCar.EngineTypes.Steam ? null : loco.LocomotiveAxles[0]);
790790
Matrix wheelRotationMatrix;
791791
if (axle != null)
@@ -800,33 +800,33 @@ private void UpdateAnimation(RenderFrame frame, ElapsedTime elapsedTime)
800800
wheelRotationMatrix = Matrix.CreateRotationX(WheelRotationR);
801801
}
802802
foreach (var iMatrix in kvp.Value)
803-
{
803+
{
804804
TrainCarShape.XNAMatrices[iMatrix] = wheelRotationMatrix * TrainCarShape.SharedShape.Matrices[iMatrix];
805-
}
805+
}
806806
}
807807
}
808808
else // set values for simple adhesion
809-
{
809+
{
810810
distanceTravelledM = ((MSTSWagon.IsDriveable && MSTSWagon.Train != null && MSTSWagon.Train.IsPlayerDriven && ((MSTSLocomotive)MSTSWagon).UsingRearCab) ? -1 : 1) * MSTSWagon.SpeedMpS * elapsedTime.ClockSeconds;
811811
if (Car.BrakeSkid) distanceTravelledM = 0;
812812
foreach (var kvp in RunningGears)
813813
{
814814
if (!kvp.Value.Empty() && AnimationDriveWheelRadiusM > 0.001)
815815
kvp.Value.UpdateLoop(distanceTravelledM / MathHelper.TwoPi / AnimationDriveWheelRadiusM);
816816
}
817-
// Wheel rotation (animation) - for non-drive wheels in steam locomotives and all wheels in other stock
818-
if (WheelPartIndexes.Count > 0)
819-
{
817+
// Wheel rotation (animation) - for non-drive wheels in steam locomotives and all wheels in other stock
818+
if (WheelPartIndexes.Count > 0)
819+
{
820820
var rotationalDistanceR = distanceTravelledM / AnimationWheelRadiusM; // in radians
821-
WheelRotationR = MathHelper.WrapAngle(WheelRotationR - rotationalDistanceR);
822-
var wheelRotationMatrix = Matrix.CreateRotationX(WheelRotationR);
821+
WheelRotationR = MathHelper.WrapAngle(WheelRotationR - rotationalDistanceR);
822+
var wheelRotationMatrix = Matrix.CreateRotationX(WheelRotationR);
823823
foreach (var kvp in WheelPartIndexes)
824-
{
824+
{
825825
foreach (var iMatrix in kvp.Value)
826826
{
827-
TrainCarShape.XNAMatrices[iMatrix] = wheelRotationMatrix * TrainCarShape.SharedShape.Matrices[iMatrix];
828-
}
829-
}
827+
TrainCarShape.XNAMatrices[iMatrix] = wheelRotationMatrix * TrainCarShape.SharedShape.Matrices[iMatrix];
828+
}
829+
}
830830
}
831831
}
832832

0 commit comments

Comments
 (0)