Skip to content

Commit 3de2b94

Browse files
committed
Automatic merge of T1.5.1-1092-g6436d559f9 and 20 pull requests
- Pull request #891 at 9a1d6b2: Auto save - Pull request #903 at 408cb1d: Downloading route content (Github, zip) - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #922 at a3bc9e7: Autopilot for timetable mode - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 53e9cc6: Multiple Track Profiles & Superelevation Improvements - Pull request #962 at 46d0472: Fix pantographs on unpowered cars - Pull request #970 at 6fa5eed: feat: Remove unnecessary Windows.Forms usage - Pull request #973 at c35be87: fix: Using singular target framework to allow for different platforms across different projects - Pull request #974 at 5faea6f: Bug fix for https://bugs.launchpad.net/or/+bug/2076034 Doors remain open in AI trains - Pull request #977 at a30c659: adds cache for SD files - Pull request #978 at 91f3ee8: fix: adds MilepostUnitsMiles to Manual - Pull request #900 at c27f32d: DMI updates - Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #952 at 8347095: Investigation - Pulsing graphics
22 parents b6d053f + 6436d55 + 9a1d6b2 + 408cb1d + 2452cb0 + e90a2aa + d00beb9 + 8f695a4 + 1f5ba4c + a3bc9e7 + a519452 + 53e9cc6 + 46d0472 + 6fa5eed + c35be87 + 5faea6f + a30c659 + 91f3ee8 + c27f32d + dfc715e + f92de76 + 8347095 commit 3de2b94

File tree

6 files changed

+16
-66
lines changed

6 files changed

+16
-66
lines changed

Source/Menu/Options.Designer.cs

Lines changed: 3 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/Options.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ orderby folder.Key
347347

348348
// Experimental tab
349349
numericUseSuperElevation.Value = Settings.UseSuperElevation;
350-
numericSuperElevationMinLen.Value = Settings.SuperElevationMinLen;
351350
numericSuperElevationGauge.Value = Settings.SuperElevationGauge;
352351
trackLODBias.Value = Settings.LODBias;
353352
trackLODBias_ValueChanged(null, null);
@@ -540,7 +539,6 @@ void buttonOK_Click(object sender, EventArgs e)
540539

541540
// Experimental tab
542541
Settings.UseSuperElevation = (int)numericUseSuperElevation.Value;
543-
Settings.SuperElevationMinLen = (int)numericSuperElevationMinLen.Value;
544542
Settings.SuperElevationGauge = (int)numericSuperElevationGauge.Value;
545543
Settings.LODBias = trackLODBias.Value;
546544
Settings.SignalLightGlow = checkSignalLightGlow.Checked;

Source/ORTS.Settings/UserSettings.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,6 @@ public enum DirectXFeature
292292
// Experimental settings:
293293
[Default(0)]
294294
public int UseSuperElevation { get; set; }
295-
[Default(50)]
296-
public int SuperElevationMinLen { get; set; }
297295
[Default(1435)]
298296
public int SuperElevationGauge { get; set; }
299297
[Default(0)]

Source/Orts.Simulation/Simulation/Physics/Train.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4544,7 +4544,7 @@ public void RepositionRearTraveller()
45444544

45454545
// Position car based on MSTS position, and rotate based on superelevation
45464546
car.WorldPosition.XNAMatrix *= Simulator.XNAMatrixFromMSTSCoordinates(traveller.X, traveller.Y, traveller.Z, x, y, z);
4547-
car.WorldPosition.XNAMatrix = Matrix.CreateRotationZ(roll) * car.WorldPosition.XNAMatrix;
4547+
car.WorldPosition.XNAMatrix = Matrix.CreateRotationZ((car.Flipped ? -1.0f : 1.0f) * roll) * car.WorldPosition.XNAMatrix;
45484548

45494549
// note the railcar sits 0.275meters above the track database path TODO - is this always consistent?
45504550
float railOffset = 0.275f;
@@ -4677,7 +4677,7 @@ public void CalculatePositionOfCars(float elapsedTime, float distance)
46774677

46784678
// Position car based on MSTS position, and rotate based on superelevation
46794679
car.WorldPosition.XNAMatrix *= Simulator.XNAMatrixFromMSTSCoordinates(traveller.X, traveller.Y, traveller.Z, x, y, z);
4680-
car.WorldPosition.XNAMatrix = Matrix.CreateRotationZ(roll) * car.WorldPosition.XNAMatrix;
4680+
car.WorldPosition.XNAMatrix = Matrix.CreateRotationZ((car.Flipped ? -1.0f : 1.0f) * roll) * car.WorldPosition.XNAMatrix;
46814681

46824682
// note the railcar sits 0.275meters above the track database path TODO - is this always consistent?
46834683
float railOffset = 0.275f;
@@ -4770,7 +4770,7 @@ public void CalculatePositionOfEOT()
47704770

47714771
// Position car based on MSTS position, and rotate based on superelevation
47724772
car.WorldPosition.XNAMatrix *= Simulator.XNAMatrixFromMSTSCoordinates(traveller.X, traveller.Y, traveller.Z, x, y, z);
4773-
car.WorldPosition.XNAMatrix = Matrix.CreateRotationZ(roll) * car.WorldPosition.XNAMatrix;
4773+
car.WorldPosition.XNAMatrix = Matrix.CreateRotationZ((car.Flipped ? -1.0f : 1.0f) * roll) * car.WorldPosition.XNAMatrix;
47744774

47754775
// note the railcar sits 0.275meters above the track database path TODO - is this always consistent?
47764776
float railOffset = 0.275f;

Source/Orts.Simulation/Simulation/Simulator.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ public class Simulator
130130
public int CarVibrating;
131131
public int UseSuperElevation; //amount of superelevation
132132
public SuperElevation SuperElevation;
133-
public int SuperElevationMinLen = 50;
134133
public float SuperElevationGauge = 1.435f;//1.435 guage
135134
public LoadStationsPopulationFile LoadStationsPopulationFile;
136135

@@ -274,7 +273,6 @@ public Simulator(UserSettings settings, string activityPath, bool useOpenRailsDi
274273
BreakCouplers = Settings.BreakCouplers;
275274
CarVibrating = Settings.CarVibratingLevel; //0 no vib, 1-2 mid vib, 3 max vib
276275
UseSuperElevation = Settings.UseSuperElevation;
277-
SuperElevationMinLen = Settings.SuperElevationMinLen;
278276
SuperElevationGauge = (float)Settings.SuperElevationGauge / 1000f;//gauge transfer from mm to m
279277
RoutePath = Path.GetDirectoryName(Path.GetDirectoryName(activityPath));
280278
if (useOpenRailsDirectory) RoutePath = Path.GetDirectoryName(RoutePath); // starting one level deeper!

Source/Orts.Simulation/Simulation/SuperElevation.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,6 @@ void MarkSections(Simulator simulator, List<TrVectorSection> SectionList, float
136136
{
137137
if (SectionList.Count <= 0)
138138
return; // Avoid errors with invalid section lists
139-
else if (totLen < simulator.SuperElevationMinLen)
140-
{
141-
// Zero out any curves that are too short
142-
foreach (TrVectorSection s in SectionList)
143-
s.NomElevM = 0;
144-
return;
145-
}
146139

147140
// The superelevation standard we will use. null means no superelevation
148141
SuperElevationStandard standard = null;
@@ -178,7 +171,17 @@ void MarkSections(Simulator simulator, List<TrVectorSection> SectionList, float
178171
}
179172

180173
if (standard == null)
174+
{
175+
foreach (TrVectorSection s in SectionList)
176+
s.NomElevM = 0;
181177
return; // No superelevation needed, stop processing here
178+
}
179+
if ((standard.MinCantM / effectiveRunoffSlope) * 2.0f > totLen * 0.75f)
180+
{
181+
foreach (TrVectorSection s in SectionList)
182+
s.NomElevM = 0;
183+
return; // Curve is so short that no meaningful superelevation can be applied
184+
}
182185

183186
// Determine proper level of superelevation for every section
184187
for (int i = 0; i < SectionList.Count; i++)

0 commit comments

Comments
 (0)