Skip to content

Commit c8e344f

Browse files
committed
Automatic merge of T1.5.1-1282-g336a70013a and 14 pull requests
- Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 62061b8: Multiple Track Profiles & Superelevation Improvements - Pull request #972 at e90a2aa: On Map window color changed switch or signal is not changed - Pull request #980 at a7406de: Downloading route content (Github, zip) second part - Pull request #981 at 10d297f: Multiple type trainset lightglows - Pull request #982 at efcf19c: WEB based Switch Panel enhancement: Alerter - Pull request #983 at 202316e: WEB based Switch Panel bug: DPU window - Pull request #984 at 0f8122e: Player train switching for timetable mode - Pull request #900 at c27f32d: DMI updates - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
16 parents 6f1f455 + 336a700 + d00beb9 + 9a1d6b2 + 1f5ba4c + 8347095 + a519452 + 62061b8 + e90a2aa + a7406de + 10d297f + efcf19c + 202316e + 0f8122e + c27f32d + f92de76 commit c8e344f

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2208,38 +2208,38 @@ public void UpdateWindComponents()
22082208
// These will be representative of the train whilst it is on a straight track, but each wagon will vary when going around a curve.
22092209
// Note both train and wind direction will be positive between 0 (north) and 180 (south) through east, and negative between 0 (north) and 180 (south) through west
22102210
// Wind and train direction to be converted to an angle between 0 and 360 deg.
2211-
// Calculate Wind speed and direction, and train direction
2212-
// Update the value of the Wind Speed and Direction for the train
2211+
// Calculate Wind speed and direction, and train direction
2212+
// Update the value of the Wind Speed and Direction for the train
22132213
PhysicsWindDirectionDeg = MathHelper.ToDegrees(Simulator.Weather.WindInstantaneousDirectionRad);
22142214
PhysicsWindSpeedMpS = Simulator.Weather.WindInstantaneousSpeedMpS;
22152215
var speedMpS = Math.Abs(SpeedMpS);
22162216

2217-
// If a westerly direction (ie -ve) convert to an angle between 0 and 360
2218-
if (PhysicsWindDirectionDeg < 0)
2219-
PhysicsWindDirectionDeg += 360;
2217+
// If a westerly direction (ie -ve) convert to an angle between 0 and 360
2218+
if (PhysicsWindDirectionDeg < 0)
2219+
PhysicsWindDirectionDeg += 360;
22202220

2221-
if (PhysicsTrainLocoDirectionDeg < 0)
2222-
PhysicsTrainLocoDirectionDeg += 360;
2221+
if (PhysicsTrainLocoDirectionDeg < 0)
2222+
PhysicsTrainLocoDirectionDeg += 360;
22232223

22242224
// Calculate angle between train and wind direction
2225-
if (PhysicsWindDirectionDeg > PhysicsTrainLocoDirectionDeg)
2226-
ResultantWindComponentDeg = PhysicsWindDirectionDeg - PhysicsTrainLocoDirectionDeg;
2227-
else if (PhysicsTrainLocoDirectionDeg > PhysicsWindDirectionDeg)
2228-
ResultantWindComponentDeg = PhysicsTrainLocoDirectionDeg - PhysicsWindDirectionDeg;
2229-
else
2230-
ResultantWindComponentDeg = 0.0f;
2225+
if (PhysicsWindDirectionDeg > PhysicsTrainLocoDirectionDeg)
2226+
ResultantWindComponentDeg = PhysicsWindDirectionDeg - PhysicsTrainLocoDirectionDeg;
2227+
else if (PhysicsTrainLocoDirectionDeg > PhysicsWindDirectionDeg)
2228+
ResultantWindComponentDeg = PhysicsTrainLocoDirectionDeg - PhysicsWindDirectionDeg;
2229+
else
2230+
ResultantWindComponentDeg = 0.0f;
22312231

2232-
// Correct wind direction if it is greater then 360 deg, then correct to a value less then 360
2233-
if (Math.Abs(ResultantWindComponentDeg) > 360)
2234-
ResultantWindComponentDeg = ResultantWindComponentDeg - 360.0f;
2232+
// Correct wind direction if it is greater then 360 deg, then correct to a value less then 360
2233+
if (Math.Abs(ResultantWindComponentDeg) > 360)
2234+
ResultantWindComponentDeg = ResultantWindComponentDeg - 360.0f;
22352235

2236-
// Wind angle should be kept between 0 and 180 the formulas do not cope with angles > 180. If angle > 180, denotes wind of "other" side of train
2237-
if (ResultantWindComponentDeg > 180)
2238-
ResultantWindComponentDeg = 360 - ResultantWindComponentDeg;
2236+
// Wind angle should be kept between 0 and 180 the formulas do not cope with angles > 180. If angle > 180, denotes wind of "other" side of train
2237+
if (ResultantWindComponentDeg > 180)
2238+
ResultantWindComponentDeg = 360 - ResultantWindComponentDeg;
22392239

22402240
var windAngleRad = MathHelper.ToRadians(ResultantWindComponentDeg);
22412241
WindResultantSpeedMpS = (float)Math.Sqrt(speedMpS * speedMpS + PhysicsWindSpeedMpS * PhysicsWindSpeedMpS + 2.0f * speedMpS * PhysicsWindSpeedMpS * (float)Math.Cos(windAngleRad));
2242-
}
2242+
}
22432243

22442244

22452245
//================================================================================================//

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3153,7 +3153,7 @@ private void UpdateWheelBearingTemperature(float elapsedClockSeconds)
31533153
private void UpdateWindForce()
31543154
{
31553155
// Calculate compensation for wind
3156-
// There are two components due to wind -
3156+
// There are two components due to wind -
31573157
// Drag, impact of wind on train, will increase resistance when head on, will decrease resistance when acting as a tailwind.
31583158
// Lateral resistance - due to wheel flange being pushed against rail due to side wind.
31593159
// Calculation based upon information provided in AREA 1942 Proceedings - https://archive.org/details/proceedingsofann431942amer - pg 56
@@ -3165,7 +3165,7 @@ private void UpdateWindForce()
31653165
var directionRad = (float)Math.Atan2(WorldPosition.XNAMatrix.M13, WorldPosition.XNAMatrix.M11);
31663166
var directionDeg = MathHelper.ToDegrees(directionRad);
31673167

3168-
// If car is flipped, then the car's direction will be reversed by 180 compared to the rest of the train, and thus for calculation purposes only,
3168+
// If car is flipped, then the car's direction will be reversed by 180 compared to the rest of the train, and thus for calculation purposes only,
31693169
// it is necessary to reverse the "assumed" direction of the car back again. This shouldn't impact the visual appearance of the car.
31703170
if (Flipped)
31713171
{
@@ -3175,12 +3175,12 @@ private void UpdateWindForce()
31753175
// If this results in an angle greater then 360, then convert it back to an angle between 0 & 360.
31763176
if (directionDeg > 360)
31773177
directionDeg -= 360;
3178-
}
3178+
}
31793179

31803180
// If a westerly direction (ie -ve) convert to an angle between 0 and 360
31813181
if (directionDeg < 0)
31823182
directionDeg += 360;
3183-
3183+
31843184
// Find angle between wind and direction of train
31853185
var resultantWindComponentDeg = 0.0f;
31863186
if (Train.PhysicsWindDirectionDeg > directionDeg)
@@ -3202,7 +3202,7 @@ private void UpdateWindForce()
32023202
var windResultantSpeedMpS = (float)Math.Sqrt(AbsSpeedMpS * AbsSpeedMpS + Train.PhysicsWindSpeedMpS * Train.PhysicsWindSpeedMpS + 2.0f * AbsSpeedMpS * Train.PhysicsWindSpeedMpS * (float)Math.Cos(resultantWindComponentRad));
32033203

32043204
// Calculate Drag Resistance
3205-
// The drag resistance will be the difference between the STILL firction calculated using the standard Davies equation,
3205+
// The drag resistance will be the difference between the STILL firction calculated using the standard Davies equation,
32063206
// and that produced using the wind resultant speed (combination of wind speed and train speed)
32073207
var tempStillDragResistanceForceN = AbsSpeedMpS * AbsSpeedMpS * DavisCNSSpMM;
32083208
var tempCombinedDragResistanceForceN = windResultantSpeedMpS * windResultantSpeedMpS * DavisCNSSpMM; // R3 of Davis formula taking into account wind
@@ -3212,7 +3212,7 @@ private void UpdateWindForce()
32123212
// This difference will be added or subtracted from the overall friction force depending upon the estimated wind direction.
32133213
if (tempCombinedDragResistanceForceN > tempStillDragResistanceForceN)
32143214
{
3215-
// Wind typically headon to train - increase resistance - +ve differential
3215+
// Wind typically headon to train - increase resistance - +ve differential
32163216
windDragResistanceForceN = tempCombinedDragResistanceForceN - tempStillDragResistanceForceN;
32173217
}
32183218
else

0 commit comments

Comments
 (0)