Skip to content

Commit 5edc101

Browse files
committed
More consistent superelevation text, one word with no hyphenation, limit use of camel case to code only
1 parent 23cb0c3 commit 5edc101

File tree

12 files changed

+78
-70
lines changed

12 files changed

+78
-70
lines changed
Binary file not shown.

Source/Documentation/Manual/developing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Rolling Stock
2222
- 3D cabs add realism.
2323
- OR graphics renders the results of the rolling stock developers at higher
2424
resolution.
25-
- Rolling stock running on super-elevated track improves gaming experience.
25+
- Rolling stock running on superelevated track improves gaming experience.
2626

2727
Routes
2828
======

Source/Documentation/Manual/features-route.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ Where x and y are a series of paired parameters specifying the curve radius (def
968968
(x value), and the amount of superelevation (default meters) (y value). The statement will take
969969
as many paired values as desired, as long as the radius values are in increasing order.
970970
Each paired set of values must have an x and y value present. If it is desired
971-
to 'hold' a certain value of SuperElevation for a number of different radii curves, then the same
971+
to 'hold' a certain value of superelevation for a number of different radii curves, then the same
972972
y value needs to be used for succeeding values of curve radius. Where the y value changes between
973973
curve radii, then Open Rails will interpolate the y value between the two points.
974974

15 KB
Loading

Source/Documentation/Manual/options.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -766,16 +766,16 @@ Some experimental features being introduced in Open Rails may be turned on
766766
and off through the *Experimental* tab of the Options window, as
767767
described below.
768768

769-
Super-elevation
769+
Superelevation
770770
---------------
771771

772-
If the value set for *Level* is greater than zero, ORTS supports super-elevation
773-
for long curved tracks. The value *Minimum Length* determines
774-
the length of the shortest curve to have super-elevation. You need to
775-
choose the correct gauge for your route, otherwise some tracks may not be
776-
properly shown.
772+
If "Use Visual Superelevation" is enabled, ORTS applies superelevation graphics
773+
to curves on every route. For the best results, you need to enter
774+
the correct gauge for your route, otherwise the resulting superelevation
775+
may not be accurate. Note that the physics system will always consider the
776+
physical effects of superelevation regardless of this setting.
777777

778-
When super-elevation is selected, two viewing effects occur at runtime:
778+
When visual superelevation is selected, two viewing effects occur at runtime:
779779

780780
1. If an external camera view is selected, the tracks and the running
781781
train will be shown inclined towards the inside of the curve.
@@ -785,9 +785,12 @@ When super-elevation is selected, two viewing effects occur at runtime:
785785
.. image:: images/options-superelevation_1.png
786786
.. image:: images/options-superelevation_2.png
787787

788-
OR implements super-elevated tracks using Dynamic Tracks. You can change
789-
the appearance of tracks by creating a ``<route folder>/TrackProfiles/
790-
TrProfile.stf`` file. The document ``How to Provide Track Profiles for
788+
The amount of superelevation applied can be customized
789+
:ref:`from within the route's .trk file <features-route-curve-superelevation>`.
790+
791+
OR implements superelevated tracks using Dynamic Tracks. You can change
792+
the appearance of tracks by creating one (or more) ``<route folder>/TrackProfiles/
793+
TrProfile.stf`` files. The document ``How to Provide Track Profiles for
791794
Open Rails Dynamic Track.pdf`` describing the creation of track profiles
792795
can be found in the *Menu > Documents* drop-down or the
793796
Open Rails ``/Source/Documentation/`` folder. Forum

Source/Documentation/Manual/physics.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3859,10 +3859,10 @@ hence were favoured for routes with tight curves.
38593859

38603860
The value used for the rigid wheelbase is shown as W in figure
38613861

3862-
Impact of Super Elevation
3863-
-------------------------
3862+
Impact of Superelevation
3863+
------------------------
38643864

3865-
On any curve whose outer rail is super-elevated there is, for any car, one
3865+
On any curve whose outer rail is superelevated there is, for any car, one
38663866
speed of operation at which the car trucks have no more tendency to run
38673867
toward either rail than they have on straight track, where both rail-heads
38683868
are at the same level (known as the equilibrium speed). At lower speeds the
@@ -3893,7 +3893,7 @@ the track curvature. This excess being a variable element of curve
38933893
resistance, we may expect to find that curve resistance reaches a minimum
38943894
value when this excess reduces to zero, that is, when the car speed reaches
38953895
the critical value referred to. This critical speed depends only on the
3896-
super-elevation, the track gauge, and the radius of the track curvature.
3896+
superelevation, the track gauge, and the radius of the track curvature.
38973897
The resulting variation of curve resistance with speed is indicated in
38983898
diagram below.
38993899

@@ -4262,8 +4262,8 @@ Typical Super Elevation Values & Speed Impact -- High Speed Passenger Routes
42624262

42634263
+-------------------------------+-------------------+-----------------------+
42644264
| |Cant D |Cant deficiency |
4265-
| |(SuperElevation) |(Unbalanced |
4266-
| |(mm) |SuperElevation) I (mm) |
4265+
| |(Superelevation) |(Unbalanced |
4266+
| |(mm) |Superelevation) I (mm) |
42674267
+===============================+===================+=======================+
42684268
|CEN (draft) -- Tilting trains |180--200 |300 |
42694269
+-------------------------------+-------------------+-----------------------+
@@ -4329,15 +4329,15 @@ above classifications.
43294329

43304330
Track gauge will default to the standard value of 4' 8.5" (1435mm).
43314331

4332-
Unbalancedsuperelevation (Cant Deficiency) will be determined from the
4332+
Unbalanced superelevation (Cant Deficiency) will be determined from the
43334333
value entered by the user, or will default to the following values:
43344334

43354335
- Conventional Freight -- 0" (0mm)
43364336
- Conventional Passenger -- 3" (75mm)
43374337
- Engines & tenders -- 6" (150mm)
43384338

43394339
Tilting trains require the addition of the relevant
4340-
unbalancedsuperelevation information to the relevant rolling stock files.
4340+
unbalanced superelevation information to the relevant rolling stock files.
43414341

43424342
.. _physics-tunnel-friction:
43434343

Source/Menu/Options.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ public Direction Direction
638638
protected float TrackGaugeM = 1.435f; // Track gauge - read in MSTSWagon
639639
protected Vector3 InitialCentreOfGravityM = new Vector3(0, 1.8f, 0); // get centre of gravity - read in MSTSWagon
640640
public Vector3 CentreOfGravityM = new Vector3(0, 1.8f, 0); // get centre of gravity after adjusted for freight animation
641-
public float SuperelevationM; // Super elevation on the curve
641+
public float SuperElevationM; // Super elevation on the curve
642642
protected float MaxUnbalancedSuperElevationM; // Maximum comfortable cant deficiency, read from MSTS Wagon File
643643
public float SuperElevationAngleRad;
644644
protected bool IsMaxSafeCurveSpeed = false; // Has equal loading speed around the curve been exceeded, ie are all the wheesl still on the track?
@@ -1879,24 +1879,24 @@ public virtual void UpdateCurveSpeedLimit(float elapsedClockSeconds)
18791879
{
18801880
#if DEBUG_USER_SUPERELEVATION
18811881
Trace.TraceInformation(" ============================================= User SuperElevation (TrainCar.cs) ========================================");
1882-
Trace.TraceInformation("CarID {0} TrackSuperElevation {1} Curve Radius {2}", CarID, SuperelevationM, CurrentCurveRadius);
1882+
Trace.TraceInformation("CarID {0} TrackSuperElevation {1} Curve Radius {2}", CarID, SuperElevationM, CurrentCurveRadius);
18831883
#endif
18841884
float s = AbsSpeedMpS; // speed of train
18851885

18861886
// Calulate equal wheel loading speed for current curve and superelevation - this was considered the "safe" speed to travel around a curve . In this instance the load on the both railes is evenly distributed.
18871887
// max equal load speed = SQRT ( (superelevation x gravity x curve radius) / track gauge)
1888-
// SuperElevation is made up of two components = rail superelevation + the amount of sideways force that a passenger will be comfortable with. This is expressed as a figure similar to superelevation.
1888+
// Superelevation is made up of two components = rail superelevation + the amount of sideways force that a passenger will be comfortable with. This is expressed as a figure similar to superelevation.
18891889

18901890
float SpeedToleranceMpS = Me.FromMi(pS.FrompH(2.5f)); // Set bandwidth tolerance for resetting notifications
18911891

18921892
// Railway companies often allow the vehicle to exceed the equal loading speed, provided that the passengers didn't feel uncomfortable, and that the car was not likely to excced the maximum critical speed
1893-
float MaxSafeCurveSpeedMps = (float)Math.Sqrt(((SuperelevationM + MaxUnbalancedSuperElevationM) * GravitationalAccelerationMpS2 * CurrentCurveRadiusM) / TrackGaugeM);
1893+
float MaxSafeCurveSpeedMps = (float)Math.Sqrt(((SuperElevationM + MaxUnbalancedSuperElevationM) * GravitationalAccelerationMpS2 * CurrentCurveRadiusM) / TrackGaugeM);
18941894

18951895
// Calculate critical speed - indicates the speed above which stock will overturn - sum of the moments of centrifrugal force and the vertical weight of the vehicle around the CoG
18961896
// critical speed = SQRT ( (centrifrugal force x gravity x curve radius) / Vehicle weight)
18971897
// centrifrugal force = Stock Weight x factor for movement of resultant force due to superelevation.
18981898

1899-
float SinTheta = SuperelevationM / TrackGaugeM; // Definition of sine: opposite / hypotenuse = superelevation / gauge
1899+
float SinTheta = SuperElevationM / TrackGaugeM; // Definition of sine: opposite / hypotenuse = superelevation / gauge
19001900
float CosTheta = (float)Math.Cos(SuperElevationAngleRad);
19011901
float HalfTrackGaugeM = TrackGaugeM / 2.0f;
19021902

@@ -2013,7 +2013,7 @@ public virtual void UpdateCurveSpeedLimit(float elapsedClockSeconds)
20132013

20142014
#if DEBUG_CURVE_SPEED
20152015
Trace.TraceInformation("================================== TrainCar.cs - DEBUG_CURVE_SPEED ==============================================================");
2016-
Trace.TraceInformation("CarID {0} Curve Radius {1} Super {2} Unbalanced {3} Durability {4}", CarID, CurrentCurveRadius, SuperelevationM, UnbalancedSuperElevationM, Simulator.CurveDurability);
2016+
Trace.TraceInformation("CarID {0} Curve Radius {1} Super {2} Unbalanced {3} Durability {4}", CarID, CurrentCurveRadius, SuperElevationM, UnbalancedSuperElevationM, Simulator.CurveDurability);
20172017
Trace.TraceInformation("CoG {0}", CentreOfGravityM);
20182018
Trace.TraceInformation("Current Speed {0} Equal Load Speed {1} Max Safe Speed {2} Critical Max Speed {3} Critical Min Speed {4}", MpS.ToMpH(s), MpS.ToMpH(MaxCurveEqualLoadSpeedMps), MpS.ToMpH(MaxSafeCurveSpeedMps), MpS.ToMpH(CriticalMaxSpeedMpS), MpS.ToMpH(CriticalMinSpeedMpS));
20192019
Trace.TraceInformation("IsMaxSafeSpeed {0} IsCriticalSpeed {1}", IsMaxSafeCurveSpeed, IsCriticalSpeed);
@@ -2066,7 +2066,7 @@ public virtual void UpdateCurveForce(float elapsedClockSeconds)
20662066

20672067
var speedConstant = 1.5f;
20682068
var MToMM = 1000;
2069-
var rspeedKgpTonne = speedConstant * Math.Abs((SpeedMpS * SpeedMpS / CurrentCurveRadiusM) - ((MToMM * SuperelevationM / MToMM * TrackGaugeM) * GravitationalAccelerationMpS2));
2069+
var rspeedKgpTonne = speedConstant * Math.Abs((SpeedMpS * SpeedMpS / CurrentCurveRadiusM) - ((MToMM * SuperElevationM / MToMM * TrackGaugeM) * GravitationalAccelerationMpS2));
20702070
var rSpeedWagonN = GravitationalAccelerationMpS2 * (Kg.ToTonne(MassKG) * rspeedKgpTonne);
20712071

20722072
CurveForceN = rBaseWagonN + rSpeedWagonN;
@@ -2801,22 +2801,10 @@ public void ComputePosition(Traveller traveler, bool backToFront, float elapsedT
28012801
for (int i = 1; i < Parts.Count; i++)
28022802
{
28032803
TrainCarPart p = Parts[i];
2804-
2804+
p.FindCenterLine();
2805+
28052806
if (p.SumWgt > 1.5f)
2806-
{
2807-
p.FindCenterLine();
28082807
p0.AddPartLocation(1, p);
2809-
}
2810-
else if (p.SumWgt > 0.5f) // Handle edge case of single axle pony trucks
2811-
{
2812-
double d = p.OffsetM.Z - p.SumZOffset / p.SumWgt;
2813-
if (-.2 < d && d < .2)
2814-
continue;
2815-
// Add a fake "wheel" to serve as a pivot point
2816-
Vector3 pos = new Vector3(p0.Pos[0] + p.OffsetM.Z * p0.Dir[0], p0.Pos[1] + p.OffsetM.Z * p0.Dir[1], p0.Pos[2] + p.OffsetM.Z * p0.Dir[2]);
2817-
p.AddWheelSetLocation(1, p.OffsetM.Z, pos, p.Roll);
2818-
p.FindCenterLine();
2819-
}
28202808
}
28212809
// Determine facing direction and position of train car
28222810
p0.FindCenterLine();
@@ -2856,7 +2844,7 @@ public void ComputePosition(Traveller traveler, bool backToFront, float elapsedT
28562844
m = rollMat * m;
28572845
}
28582846

2859-
SuperelevationInverseMatrix = Matrix.Invert(rollMat);
2847+
SuperElevationInverseMatrix = Matrix.Invert(rollMat);
28602848

28612849
// Set position of train car
28622850
m.Translation += new Vector3(p0.Pos[0], p0.Pos[1], -p0.Pos[2]);
@@ -2866,6 +2854,23 @@ public void ComputePosition(Traveller traveler, bool backToFront, float elapsedT
28662854
WorldPosition.TileZ = tileZ;
28672855

28682856
UpdateVibration(traveler, elapsedTimeS, distance, speed);
2857+
2858+
// Check bogies for any corrections needed
2859+
for (int i = 1; i < Parts.Count; i++)
2860+
{
2861+
TrainCarPart p = Parts[i];
2862+
2863+
if (p.SumWgt < 1.5f && p.SumWgt > 0.5f) // Handle edge case of single axle pony trucks
2864+
{
2865+
double d = p.OffsetM.Z - p.SumZOffset / p.SumWgt;
2866+
if (-.2 < d && d < .2)
2867+
continue;
2868+
// Add a fake "wheel" to serve as a pivot point
2869+
Vector3 pos = new Vector3(p0.Pos[0] + p.OffsetM.Z * p0.Dir[0], p0.Pos[1] + p.OffsetM.Z * p0.Dir[1], p0.Pos[2] + p.OffsetM.Z * p0.Dir[2]);
2870+
p.AddWheelSetLocation(1, p.OffsetM.Z, pos, p.Roll);
2871+
p.FindCenterLine();
2872+
}
2873+
}
28692874
}
28702875

28712876
#region Traveller-based updates
@@ -2898,7 +2903,7 @@ internal void UpdateTilting(Traveller traveller, float elapsedTimeS, float spee
28982903
}
28992904
#endregion
29002905

2901-
#region Super-elevation
2906+
#region SuperElevation
29022907
/// <summary>
29032908
/// Determines the curve situation (superelevation and radius) of the train car, given a
29042909
/// traveller to move over an array of offsets to average out the curve across.
@@ -2915,9 +2920,9 @@ public void UpdateCurvePhys(Traveller traveller, float[] offsets)
29152920
traveller.GetCurveData(offsets, out float[] physicsElevation, out float[] curveRadii);
29162921

29172922
// Superelevation MUST be limited to track gauge to avoid NaN errors
2918-
SuperelevationM = Math.Min(physicsElevation.Average(), TrackGaugeM);
2923+
SuperElevationM = Math.Min(physicsElevation.Average(), TrackGaugeM);
29192924
// Set superelevation angle used by physics system
2920-
SuperElevationAngleRad = (float)Math.Asin(SuperelevationM / TrackGaugeM);
2925+
SuperElevationAngleRad = (float)Math.Asin(SuperElevationM / TrackGaugeM);
29212926

29222927
CurrentCurveRadiusM = curveRadii.Average();
29232928
// Straight track has a "radius" of infinity, but rest of code expects straight to have a "radius" of 0
@@ -2928,7 +2933,7 @@ public void UpdateCurvePhys(Traveller traveller, float[] offsets)
29282933

29292934
#region Vibration and tilting
29302935
public Matrix VibrationInverseMatrix = Matrix.Identity;
2931-
public Matrix SuperelevationInverseMatrix = Matrix.Identity;
2936+
public Matrix SuperElevationInverseMatrix = Matrix.Identity;
29322937

29332938
// https://en.wikipedia.org/wiki/Newton%27s_laws_of_motion#Newton.27s_2nd_Law
29342939
// Let F be the force in N

Source/RunActivity/Viewer3D/Cameras.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,7 +1285,7 @@ public override void Update(ElapsedTime elapsedTime)
12851285
LookedAtPosition = new WorldPosition(attachedCar.WorldPosition);
12861286

12871287
// Cancel out unwanted effects on camera motion caused by vibration and superelevation
1288-
LookedAtPosition.XNAMatrix = attachedCar.SuperelevationInverseMatrix * attachedCar.VibrationInverseMatrix * LookedAtPosition.XNAMatrix;
1288+
LookedAtPosition.XNAMatrix = attachedCar.SuperElevationInverseMatrix * attachedCar.VibrationInverseMatrix * LookedAtPosition.XNAMatrix;
12891289
}
12901290
UpdateLocation(LookedAtPosition);
12911291
UpdateListener();

Source/RunActivity/Viewer3D/DynamicTrack.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ public class TrProfile
546546
/// <summary>
547547
/// The type of superelevation used (ie: which rail is superelevated)
548548
/// </summary>
549-
public enum SuperelevationMethod
549+
public enum SuperElevationMethod
550550
{
551551
/// <summary>
552552
/// No superelevation - graphical superelevation disabled
@@ -568,7 +568,7 @@ public enum SuperelevationMethod
568568
/// </summary>
569569
Inside,
570570
}
571-
public SuperelevationMethod ElevationType = SuperelevationMethod.Outside;
571+
public SuperElevationMethod ElevationType = SuperElevationMethod.Outside;
572572

573573
/// <summary>
574574
/// Enumeration of LOD control methods
@@ -629,7 +629,7 @@ public TrProfile(Viewer viewer)
629629
//PitchControl = PitchControls.ChordDisplacement; // Target chord displacement from arc
630630
//PitchControlScalar = 0.034f; // Hold to no more than 34 mm (half rail width)
631631
TrackGaugeM = 1.435f; // Kuju track profile depicts standard gauge track
632-
ElevationType = SuperelevationMethod.Outside; // Superelevate the outside rail only to reduce clipping
632+
ElevationType = SuperElevationMethod.Outside; // Superelevate the outside rail only to reduce clipping
633633

634634
LOD lod; // Local LOD instance
635635
LODItem lodItem; // Local LODItem instance
@@ -923,24 +923,24 @@ public static LODMethods GetLODMethod(string sLODMethod)
923923
}
924924

925925
/// <summary>
926-
/// Gets a member of the SuperelevationMethod enumeration that corresponds to sElevMethod.
926+
/// Gets a member of the SuperElevationMethod enumeration that corresponds to sElevMethod.
927927
/// </summary>
928-
/// <param name="sElevMethod">String that identifies desired SuperelevationMethod.</param>
929-
/// <returns>SuperelevationMethod</returns>
930-
public static SuperelevationMethod GetElevMethod(string sElevMethod)
928+
/// <param name="sElevMethod">String that identifies desired SuperElevationMethod.</param>
929+
/// <returns>SuperElevationMethod</returns>
930+
public static SuperElevationMethod GetElevMethod(string sElevMethod)
931931
{
932932
string s = sElevMethod.ToLower();
933933
switch (s)
934934
{
935935
case "none":
936-
return SuperelevationMethod.None;
936+
return SuperElevationMethod.None;
937937
case "both":
938-
return SuperelevationMethod.Both;
938+
return SuperElevationMethod.Both;
939939
case "inside":
940-
return SuperelevationMethod.Inside;
940+
return SuperElevationMethod.Inside;
941941
case "outside":
942942
default:
943-
return SuperelevationMethod.Outside;
943+
return SuperElevationMethod.Outside;
944944
}
945945
}
946946

0 commit comments

Comments
 (0)