Skip to content

Commit 657d222

Browse files
committed
Automatic merge of T1.5.1-905-gaf8fb30c5 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 9c456aa: 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 #903 at 9bead33: Downloading route content (Github, zip) - Pull request #911 at 6834af0: docs: Add refactoring as a special type of PR - Pull request #912 at d595703: New Triple Valve Features Vol. 2 - Pull request #919 at 7aafe02: Added mouse wheel support for controls which can be moved by pressing t… - Pull request #920 at a94e403: Update RailDriver in Manual
15 parents 8069d35 + af8fb30 + 3539862 + d00beb9 + f92de76 + 9c456aa + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 9bead33 + 6834af0 + d595703 + 7aafe02 + a94e403 commit 657d222

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
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-
}
784+
}
785785

786-
}
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

Source/RunActivity/Viewer3D/Trains.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void LoadPrep()
133133
var visibleCars = new List<TrainCar>();
134134
var removeDistance = Viewer.Settings.ViewingDistance * 1.5f;
135135
if (Viewer.PlayerLocomotive != null)
136-
visibleCars.Add(Viewer.PlayerLocomotive);
136+
visibleCars.Add(Viewer.PlayerLocomotive);
137137
foreach (var train in Viewer.Simulator.Trains)
138138
foreach (var car in train.Cars)
139139
if (WorldLocation.ApproximateDistance(Viewer.Camera.CameraWorldLocation, car.WorldPosition.WorldLocation) < removeDistance && car != Viewer.PlayerLocomotive)

0 commit comments

Comments
 (0)