Skip to content

Commit d4e9fa0

Browse files
committed
Automatic merge of T1.5.1-870-ge0bf062eb and 16 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 #897 at 42f1dd9: feat: Improved system information collection - Pull request #903 at 9bead33: Downloading route content (Github, zip) - Pull request #907 at 9b0b04f: Bug fix for https://bugs.launchpad.net/or/+bug/2047300 Dynamic tracks disappear after long tunnel - 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 #914 at 476d67b: Adjustments to Duplex steam - Pull request #915 at 6d911d7: Correct calculation error with curve friction - Pull request #917 at a948dbe: Lighting Configuration Enhancements
18 parents 58461ba + e0bf062 + 3539862 + d00beb9 + f92de76 + 9c456aa + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 42f1dd9 + 9bead33 + 9b0b04f + 6834af0 + d595703 + 476d67b + 6d911d7 + a948dbe commit d4e9fa0

File tree

6 files changed

+171
-82
lines changed

6 files changed

+171
-82
lines changed

Source/Documentation/Manual/features-rollingstock.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,49 @@ implementation takes up much less space and guarentees that both modes of the
9191
light have the exact same ``States``. There is no hard limit on the number
9292
of conditions a light can have.
9393

94+
Lights attached to shape sub-objects
95+
------------------------------------
96+
97+
The standard lighting configuration attaches all lights to the main body of the
98+
locomotive or wagon. While this allows lights to move and rotate as the vehicle
99+
itself moves, the approach has proven insufficient for more complicated rail
100+
vehicles such as articulated steam locomotives.
101+
102+
.. index::
103+
single: ShapeHierarchy
104+
105+
To facilitate lighting on such locomotives and wagons, Open Rails now allows
106+
for attachment of lights to any sub-object of the shape file. With the
107+
``ShapeHierarchy`` token placed in a ``Light ()`` block, the object the light
108+
will rotate and translate with can be defined using the hierarchy name of said
109+
object. Tools such as Shape Viewer can be used to determine the hierarchy name
110+
of a particular object in the shape file. For example, *"BOGIE1"* is the standard
111+
name for the frontmost bogie. A light attached to this bogie could be created
112+
like so::
113+
114+
Light (
115+
comment( CNDR Side Front Truck Light )
116+
ShapeHierarchy ( "BOGIE1" )
117+
States ( 1
118+
State (
119+
LightColour ( 91fedf91 )
120+
Position ( -1.427 0.583 -0.330 )
121+
Azimuth ( -90 -90 -90 )
122+
Radius ( 0.2 )
123+
)
124+
)
125+
)
126+
127+
Be aware that the ``Position`` of a light is measured relative to the center of
128+
the object to which the light is attached, not to the center of the locomotive
129+
itself. Furthermore, the naming of shape parts is not consistent between all
130+
shape files. If the shape name entered in ``ShapeHierarchy`` is invalid, a
131+
warning will be produced in the log file and the light will attach to the
132+
main body of the locomotive or wagon.
133+
134+
If ``ShapeHierarchy`` is not specified in a light, the light will attach
135+
to the main body of the locomotive or wagon by default.
136+
94137
.. _features-light-conditions:
95138

96139
Open Rails specific lighting conditions

Source/Documentation/Manual/news.rst

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,43 @@ New since previous version of Open Rails
55
****************************************
66

77
A summary of the new and improved features can be found below.
8-
In addition, a number of minor bugs have been fixed in this release.
8+
In addition, over 170 bugs have been fixed in this release.
99

1010
Please keep `reporting bugs and suggesting new features <http://openrails.org/contribute/reporting-bugs/>`_
1111
so Open Rails can continue to improve.
1212

1313

14+
Headlines
15+
---------
16+
17+
- Container Loading and Unloading
18+
19+
1420
What's been added
1521
-----------------
1622

17-
- detailed map which tracks player train
18-
- partial turntables
19-
- cab controls operated remotely from a tablet or control desk
20-
- animations for cab windows
21-
- options to configure RailDriver
22-
- more accurate wheelslip using Polach adhesion
23-
- duplex and booster steam engines (e.g. T1 class)
24-
- cloud-free skies
25-
- more air and dynamic brake options for locos
26-
- mouse control for scripted brake controllers
23+
- End Of Train (EOT) devices
24+
- Distributed Power display, in-cab and on webpage
25+
- Progress bar for timetable "pre-run"
26+
- HUD extended for diesel-mechanical loco
27+
- New features for loco/wagon lighting, including horn-activated flashing ditch lights
28+
2729

2830

2931
What's been improved
3032
--------------------
3133

32-
- sky, sunrise and sunset appearance
33-
- wheelslip, exhaust and steam
34-
- layout of map window
35-
- F9 menu for controlling cars and brakes
36-
- controls for electric locos
37-
- air brake features for both European and American brake systems
38-
- accurate friction simulation for 4 types of brake shoes
34+
- 64-bit compatibility lifting the 3GB RAM limit
35+
- Better use of VRAM
3936

4037

4138

4239
Other changes
4340
--------------------
4441

45-
- distracting “z-fighting” has been minimised
46-
- inactive windows are indicated when several windows are open
42+
- F5 key now opens Driver Info window. For HUD, use Alt+F5
43+
- Some trial options are now always active including:
44+
45+
- map window (Ctrl+9)
46+
- de-brief evaluation (F1)
47+
- web server

Source/Orts.Formats.Msts/LightCollection.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ public LightCondition(LightCondition condition, bool reverse)
338338
public class Light
339339
{
340340
public int Index;
341+
public int ShapeIndex = -1;
342+
public string ShapeHierarchy;
341343
public LightType Type;
342344
public bool Cycle;
343345
public float FadeIn;
@@ -369,12 +371,16 @@ public Light(int index, STFReader stf)
369371
if (States.Count < count)
370372
STFException.TraceWarning(stf, (count - States.Count).ToString() + " missing State(s)");
371373
}),
374+
new STFReader.TokenProcessor("shapeindex", ()=>{ ShapeIndex = stf.ReadIntBlock(null); }),
375+
new STFReader.TokenProcessor("shapehierarchy", ()=>{ ShapeHierarchy = stf.ReadStringBlock(null).ToUpper(); }),
372376
});
373377
}
374378

375379
public Light(Light light, bool reverse)
376380
{
377381
Index = light.Index;
382+
ShapeIndex = light.ShapeIndex;
383+
ShapeHierarchy = light.ShapeHierarchy;
378384
Type = light.Type;
379385
Cycle = light.Cycle;
380386
FadeIn = light.FadeIn;
@@ -396,6 +402,11 @@ public class LightCollection
396402
{
397403
public List<Light> Lights = new List<Light>();
398404

405+
// Array of bools, one per type of condition in the same order as presented in the 'LightCondition' class
406+
// A 'true' indicates all lights in this set ignore the corresponding condition, so we don't need to waste time thinking about it
407+
// Remember to expand this if more conditions are added!
408+
public bool[] IgnoredConditions = new bool[15];
409+
399410
public LightCollection(STFReader stf)
400411
{
401412
stf.MustMatch("(");
@@ -410,6 +421,23 @@ public LightCollection(STFReader stf)
410421
foreach (var light in Lights.ToArray())
411422
if (light.Type == LightType.Cone)
412423
Lights.Add(new Light(light, true));
424+
425+
// Determine which, if any, conditions are ignored by all conditions of all lights
426+
IgnoredConditions[0] = Lights.All(light => light.Conditions.All(cond => cond.Headlight == LightHeadlightCondition.Ignore));
427+
IgnoredConditions[1] = Lights.All(light => light.Conditions.All(cond => cond.Unit == LightUnitCondition.Ignore));
428+
IgnoredConditions[2] = Lights.All(light => light.Conditions.All(cond => cond.Penalty == LightPenaltyCondition.Ignore));
429+
IgnoredConditions[3] = Lights.All(light => light.Conditions.All(cond => cond.Control == LightControlCondition.Ignore));
430+
IgnoredConditions[4] = Lights.All(light => light.Conditions.All(cond => cond.Service == LightServiceCondition.Ignore));
431+
IgnoredConditions[5] = Lights.All(light => light.Conditions.All(cond => cond.TimeOfDay == LightTimeOfDayCondition.Ignore));
432+
IgnoredConditions[6] = Lights.All(light => light.Conditions.All(cond => cond.Weather == LightWeatherCondition.Ignore));
433+
IgnoredConditions[7] = Lights.All(light => light.Conditions.All(cond => cond.Coupling == LightCouplingCondition.Ignore));
434+
IgnoredConditions[8] = Lights.All(light => light.Conditions.All(cond => cond.Battery == LightBatteryCondition.Ignore));
435+
IgnoredConditions[9] = Lights.All(light => light.Conditions.All(cond => cond.Brake == LightBrakeCondition.Ignore));
436+
IgnoredConditions[10] = Lights.All(light => light.Conditions.All(cond => cond.Reverser == LightReverserCondition.Ignore));
437+
IgnoredConditions[11] = Lights.All(light => light.Conditions.All(cond => cond.Doors == LightDoorsCondition.Ignore));
438+
IgnoredConditions[12] = Lights.All(light => light.Conditions.All(cond => cond.Horn == LightHornCondition.Ignore));
439+
IgnoredConditions[13] = Lights.All(light => light.Conditions.All(cond => cond.Bell == LightBellCondition.Ignore));
440+
IgnoredConditions[14] = Lights.All(light => light.Conditions.All(cond => cond.MU == LightMUCondition.Ignore));
413441
}
414442
}
415443
}

0 commit comments

Comments
 (0)