From 37110ad34a6969f212db583f1bae79d4c0d21efa Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 19 Nov 2020 14:22:58 +0000 Subject: [PATCH 01/16] TREE_LIST documentation updates Thanks to Rick Gruber-Riemer for proof-reading. --- Docs/README.scenery | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Docs/README.scenery b/Docs/README.scenery index 7035990bd..641526c0c 100644 --- a/Docs/README.scenery +++ b/Docs/README.scenery @@ -19,6 +19,7 @@ Contents ---------------------------------------------------------------------- 3.7 ROAD_ROUGH / ROAD_DETAILED 3.8 RAILWAY_ROUGH / RAILWAY_DETAILED 3.9 BUILDING_LIST + 3.10 TREE_LIST 4 model manager ("/models/model") 4.1 static objects @@ -280,8 +281,8 @@ this is an expensive operation and is strongly discouraged. --------------------------------- defines taxiway or runway sign. The syntax is much like that of OBJECT_SHARED -entries, except that the path is replaced with a sign contents specification -and that there is an additional size value at the end of the line. +entries, except that the is replaced with a sign contents specification +and that is replaced with a size value at the end of the line. Example: @@ -392,7 +393,7 @@ gradually fade in 3.7 ROAD_ROUGH / ROAD_DETAILED ------------------------------- -Identical to BUILDING_ROUGH / BIULDING_DETAILED above, except used for roads. +Identical to BUILDING_ROUGH / BUILDING_DETAILED above, except used for roads. the material definition "OSM_Road" is applied. 3.8 RAILWAY_ROUGH / RAILWAY_DETAILED @@ -463,7 +464,7 @@ For example, the following entries generates 3 small, 2 medium and 2 large build 0 400 0 0 1 0 500 0 0 2 -3.9 TREE_LIST +3.10 TREE_LIST ------------------ Defines a file containing tree coordinates that should be rendered using @@ -485,7 +486,7 @@ Where: the point at which the material definition will be evaluated (for regional materials). -See README.materials for details on configuring the random building parameters. +See README.materials for details on configuring the random vegetation parameters. The referenced (in the example trees.txt.gz) contains lines of the form From 010bd8c1459dd605d6294a0aa86f53eb4181eca0 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 19 Nov 2020 18:44:00 +0000 Subject: [PATCH 02/16] Fix props.condition Previously props.condition threw an error if any of the properties in the condition were not defines. This is contrary to the behaviour of SGCondition, which it seeks to emulate, which considers such undefined properties as having the value 0.0. Now this is the case. This function only appears to be used by tutorials.nas, where this behaviour was seen as discrepancy between the checklist behaviour and the tutorial behaviour. See https://sourceforge.net/p/flightgear/codetickets/2394/?page=1 --- Nasal/props.nas | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Nasal/props.nas b/Nasal/props.nas index 31ce8108b..7578f4f11 100644 --- a/Nasal/props.nas +++ b/Nasal/props.nas @@ -452,11 +452,10 @@ var _cond_cmp = func(p, op) { return nil; } } - if(left == nil or right == nil) { - logprint(LOG_ALERT, "condition: comparing with nil"); - dump(p); - return nil; - } + + if (left == nil) left = 0.0; + if (right == nil) right = 0.0; + if(op < 0) return left < right; if(op > 0) return left > right; return left == right; From a56d13640d2bdcc904f65d81b34a461d383b6944 Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 19 Nov 2020 19:03:07 +0000 Subject: [PATCH 03/16] Hide pilot model when walker enabled. Previously pilot models would stay visible when the walker was active. Which is a bit unrealistic given the walker is supposed to be "you" in some way. So now the internal pilot is hidden when the walker is active outside the aircraft. Fix provided by Benedikt Hallinger --- Aircraft/Generic/Pilot/Airliner/pilot.xml | 5 ++++- Aircraft/Generic/Pilot/Fighter/pilot.xml | 5 ++++- Aircraft/Generic/Pilot/General/pilot.xml | 5 ++++- Aircraft/Generic/Pilot/WWI/pilot.xml | 5 ++++- Aircraft/Generic/Pilot/WWII/pilot.xml | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Aircraft/Generic/Pilot/Airliner/pilot.xml b/Aircraft/Generic/Pilot/Airliner/pilot.xml index a329930ca..943adbcc3 100644 --- a/Aircraft/Generic/Pilot/Airliner/pilot.xml +++ b/Aircraft/Generic/Pilot/Airliner/pilot.xml @@ -68,7 +68,10 @@ - /sim/current-view/internal + + /sim/current-view/internal + /sim/walker/outside + /sim/rendering/pilot-model/enabled diff --git a/Aircraft/Generic/Pilot/Fighter/pilot.xml b/Aircraft/Generic/Pilot/Fighter/pilot.xml index f64cb0ec9..80d13805c 100644 --- a/Aircraft/Generic/Pilot/Fighter/pilot.xml +++ b/Aircraft/Generic/Pilot/Fighter/pilot.xml @@ -61,7 +61,10 @@ - /sim/current-view/internal + + /sim/current-view/internal + /sim/walker/outside + /sim/rendering/pilot-model/enabled diff --git a/Aircraft/Generic/Pilot/General/pilot.xml b/Aircraft/Generic/Pilot/General/pilot.xml index 3dbd907b8..7915df516 100644 --- a/Aircraft/Generic/Pilot/General/pilot.xml +++ b/Aircraft/Generic/Pilot/General/pilot.xml @@ -68,7 +68,10 @@ - /sim/current-view/internal + + /sim/current-view/internal + /sim/walker/outside + /sim/rendering/pilot-model/enabled diff --git a/Aircraft/Generic/Pilot/WWI/pilot.xml b/Aircraft/Generic/Pilot/WWI/pilot.xml index 98083cac6..674be727b 100644 --- a/Aircraft/Generic/Pilot/WWI/pilot.xml +++ b/Aircraft/Generic/Pilot/WWI/pilot.xml @@ -68,7 +68,10 @@ - /sim/current-view/internal + + /sim/current-view/internal + /sim/walker/outside + /sim/rendering/pilot-model/enabled diff --git a/Aircraft/Generic/Pilot/WWII/pilot.xml b/Aircraft/Generic/Pilot/WWII/pilot.xml index 51eb15e2a..15a6c192e 100644 --- a/Aircraft/Generic/Pilot/WWII/pilot.xml +++ b/Aircraft/Generic/Pilot/WWII/pilot.xml @@ -68,7 +68,10 @@ - /sim/current-view/internal + + /sim/current-view/internal + /sim/walker/outside + /sim/rendering/pilot-model/enabled From d315d6953054bce716f15f700ca28912bb85cabf Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Thu, 19 Nov 2020 19:34:45 +0000 Subject: [PATCH 04/16] Make ufo invisible over MP again Before fallback models were introduced, the ufo was invisible to other MP pilots that were not in a ufo themselves. When fallback models were introduced, at long range the ufo was replaced by the glider model, and so became visible. This change makes it invisible again by using the ufo as its own fallback model. This is safe because the ufo model is very lightweight and also shipped with fgdata. --- AI/Aircraft/fallback_models.xml | 25 +++++++++++++++++-------- Aircraft/ufo/ufo-set.xml | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/AI/Aircraft/fallback_models.xml b/AI/Aircraft/fallback_models.xml index 3f25a4314..12edd5a77 100644 --- a/AI/Aircraft/fallback_models.xml +++ b/AI/Aircraft/fallback_models.xml @@ -16,14 +16,18 @@ 0 Default. Will also be used if an AI model is not found 1-50 Single engine GA aircraft 51-100 Multi-engine GA aircraft - 101-150 Turboprop airliners - 151-200 Twin engined narrow body jet airliners - 201-250 Twin engined wide body jet airliners - 251-300 Four engined jet airliners - 301-350 Military combat aircraft - 351-400 Military non-combat aircraft (tankers, transports) - 401-500 ???? - + 101-150 Business Jets + 151-200 Turboprop airliners + 201-250 Twin engined narrow body jet airliners + 251-300 Twin engined wide body jet airliners + 301-350 Four engined jet narrow body airliners + 351-400 Four engined jet wide body airliners + 401-450 Single engine prop military aircraft + 451-500 Multi-engine prop military aircraft + 501-550 Jet combat aircraft + 551-600 Military large aircraft (tankers, transports) + 601-700 Helicopters + 701-800 Other --> @@ -172,4 +176,9 @@ AI/Aircraft/G-164/Models/G-164A-ai.xml AI/Aircraft/Gee-Bee/Models/geebee-ai.xml + +Aircraft/ufo/Models/ufo.xml + diff --git a/Aircraft/ufo/ufo-set.xml b/Aircraft/ufo/ufo-set.xml index e22e7d354..da0dfc10c 100644 --- a/Aircraft/ufo/ufo-set.xml +++ b/Aircraft/ufo/ufo-set.xml @@ -78,7 +78,7 @@ 0 3 - + 712 From f125b754296ecf17755971855050db96e76ebdd1 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 18 Nov 2020 10:43:38 +0000 Subject: [PATCH 05/16] Joystick-config: fix ToggleButton, add AP-DISC Fix the created binding for toggle buttons. Add autopilotDisconnect helper to controls.nas, and expose the new function in the joystick configurator dialog. Fixes from Henning Stahlke --- Nasal/controls.nas | 7 +++++++ Nasal/joystick.nas | 3 ++- gui/dialogs/button-config.xml | 13 +++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Nasal/controls.nas b/Nasal/controls.nas index 4dd851bbd..b2c908126 100644 --- a/Nasal/controls.nas +++ b/Nasal/controls.nas @@ -558,6 +558,13 @@ var applyApplicableBrakes = func(v, which = 0) { } } +var autopilotDisconnect = func() { + var aps = props.getNode("/controls/autoflight").getChildren("autopilot"); + foreach (var ap; aps) { + ap.getChild("engage").setBoolValue(0); + } +} + # 1: Deploy, -1: Release var deployChute = func(v) setprop("/controls/flight/drag-chute", v); diff --git a/Nasal/joystick.nas b/Nasal/joystick.nas index 536193da1..01a060052 100644 --- a/Nasal/joystick.nas +++ b/Nasal/joystick.nas @@ -418,7 +418,7 @@ var PropertyToggleButton = { var c = prop.getNode("binding", 1).getNode("command", 1).getValue(); var p = prop.getNode("binding", 1).getNode("property", 1).getValue(); - return ((c == "property-toggle") and (p == me.prop)); + return ((c == "property-toggle") and (p == me.binding)); }, getBinding: func(button) { @@ -566,6 +566,7 @@ var buttonBindings = [ NasalHoldButton.new("Brakes (air/wheel)", "controls.applyApplicableBrakes(1);", "controls.applyApplicableBrakes(0);"), NasalHoldButton.new("Parking brakes", "controls.parkingBrakeToggle(0);", "controls.parkingBrakeToggle(1);"), NasalHoldButton.new("NWS toggle", "controls.toggleNWS(0);", "controls.toggleNWS(1);"), + NasalButton.new("Autopilot disconnect", "controls.autopilotDisconnect();",0), PropertyToggleButton.new("Total Freeze", "/sim/freeze/clock"), diff --git a/gui/dialogs/button-config.xml b/gui/dialogs/button-config.xml index 21cd9fb90..42a997934 100644 --- a/gui/dialogs/button-config.xml +++ b/gui/dialogs/button-config.xml @@ -486,6 +486,19 @@ var assignButton = func(cmd) { + + 0 4 From c874567679912922913ef87838ef6b90efb298d6 Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Sat, 21 Nov 2020 02:12:02 -0600 Subject: [PATCH 06/16] Local weather: setprop() passed a NaN in local_weather/weather_tiles.nas, line 2795 Tiecket: #2423 --- Nasal/local_weather/weather_tiles.nas | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Nasal/local_weather/weather_tiles.nas b/Nasal/local_weather/weather_tiles.nas index e88ea6445..37ab2c55a 100644 --- a/Nasal/local_weather/weather_tiles.nas +++ b/Nasal/local_weather/weather_tiles.nas @@ -2779,15 +2779,15 @@ var set_METAR_weather_station = func { # also compute and set gust wind info var gust_angvar = 0.5 * weather_tile_management.relangle(wind_range_from, wind_range_to); - + + var gust_relative_strength = 0.0; if ((gust_strength > 0.0) or (gust_angvar > 0.0)) { - var gust_relative_strength = (gust_strength - windspeed)/windspeed; + gust_relative_strength = (gust_strength - windspeed)/windspeed; setprop(lw~"tmp/gust-frequency-hz", 0.2 + rand()*0.8); } else { - var gust_relative_strength = 0.0; setprop(lw~"tmp/gust-frequency-hz", 0.0); } From a150e89e9b94241344cbcbbd893baf961f23e5c1 Mon Sep 17 00:00:00 2001 From: Scott Giese Date: Sat, 21 Nov 2020 02:12:39 -0600 Subject: [PATCH 07/16] Index out of range (-1) --- .../local_weather/weather_tile_management.nas | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Nasal/local_weather/weather_tile_management.nas b/Nasal/local_weather/weather_tile_management.nas index 3bf608e2c..19d3f6dd9 100644 --- a/Nasal/local_weather/weather_tile_management.nas +++ b/Nasal/local_weather/weather_tile_management.nas @@ -1484,23 +1484,23 @@ foreach(s; cloudShadowArray) } # now write out the closest cloud for the detail effects + if (index_min != -1) { + var s = cloudShadowArray[index_min]; + + diffx = (s.lat - eyeLat) * local_weather.lat_to_m + offset_x; + diffy = -(s.lon - eyeLon) * local_weather.lon_to_m + offset_y; + + setprop("/local-weather/cloud-shadows/nearest-cloudpos-x",int(diffx) + s.size); + setprop("/local-weather/cloud-shadows/nearest-cloudpos-y",int(diffy) + s.strength ); + + + #print("Dist_max:", dist_max, " index_max: ", index_max); + cloudShadowMinIndex = index_max; + if (dist_max > 0.0) {cloudShadowMaxDist = dist_max;} + } - var s = cloudShadowArray[index_min]; - - diffx = (s.lat - eyeLat) * local_weather.lat_to_m + offset_x; - diffy = -(s.lon - eyeLon) * local_weather.lon_to_m + offset_y; - - setprop("/local-weather/cloud-shadows/nearest-cloudpos-x",int(diffx) + s.size); - setprop("/local-weather/cloud-shadows/nearest-cloudpos-y",int(diffy) + s.strength ); - - - #print("Dist_max:", dist_max, " index_max: ", index_max); - cloudShadowMinIndex = index_max; - if (dist_max > 0.0) {cloudShadowMaxDist = dist_max;} - - -settimer( func {shadow_management_loop(i)}, 0); -} + settimer( func {shadow_management_loop(i)}, 0); +} From eebf07d9f687370c9d79c8be10b6ed0733ce57a4 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Fri, 20 Nov 2020 22:20:12 +0000 Subject: [PATCH 08/16] Add user control of whether mouse controls elevator when left button is down. defaults.xml Set new property /sim/mouse/mouse-rudder-elevator to false, but with userarchive="y". gui/dialogs/input-config.xml Added checkbox to control /sim/mouse/mouse-rudder-elevator. mice.xml: Allow mouse control of elevator with button 0 down if /sim/mouse/mouse-rudder-elevator is true. --- defaults.xml | 1 + gui/dialogs/input-config.xml | 31 ++++++++++++++++++++++++++++++- mice.xml | 14 ++++++-------- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/defaults.xml b/defaults.xml index acdfcdeff..171a29713 100644 --- a/defaults.xml +++ b/defaults.xml @@ -732,6 +732,7 @@ Started September 2000 by David Megginson, david@megginson.com 1.0 false false + false 90 diff --git a/gui/dialogs/input-config.xml b/gui/dialogs/input-config.xml index d35892afd..4903100b7 100644 --- a/gui/dialogs/input-config.xml +++ b/gui/dialogs/input-config.xml @@ -209,6 +209,35 @@ 1 + + + + + + + left + top + table + + + + left + + 0 + 0 + + + + left + + /sim/mouse/mouse-rudder-elevator + + dialog-apply + + 0 + 1 + + 1 @@ -217,7 +246,7 @@ left - + diff --git a/mice.xml b/mice.xml index b1845170c..9594a75ed 100644 --- a/mice.xml +++ b/mice.xml @@ -151,19 +151,17 @@ current mode for each mouse is held in the - - - /devices/status/mice/mouse[0]/button[1] - property-adjust /controls/flight/elevator From f280f0a4238bccd3235cfcb70f0d2ad11ba23ef6 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Thu, 19 Nov 2020 21:07:39 +0000 Subject: [PATCH 09/16] Added support to View menu for CompositeViewer. --- Translations/default/menu.xml | 4 ++++ gui/menubar.xml | 43 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/Translations/default/menu.xml b/Translations/default/menu.xml index 65b2e061d..511d853a0 100644 --- a/Translations/default/menu.xml +++ b/Translations/default/menu.xml @@ -21,6 +21,10 @@ View + Add Clone View + Push Pair View + Add Pair View + Add Pair Foreground View Toggle Fullscreen Rendering Options View Options diff --git a/gui/menubar.xml b/gui/menubar.xml index f2017e837..199fdf5e6 100644 --- a/gui/menubar.xml +++ b/gui/menubar.xml @@ -93,6 +93,49 @@ view + + + /sim/rendering/composite-viewer-enabled + + view-clone + Sup-v + + view-clone + + + + + + /sim/rendering/composite-viewer-enabled + + view-push + + view-push + + + + + + /sim/rendering/composite-viewer-enabled + + view-last-pair + Sup-V + + view-last-pair + + + + + + /sim/rendering/composite-viewer-enabled + + view-last-pair-double + + + view-last-pair-double + + + toggle-fullscreen Shift-F10 From 50c76ec3387837cadbee217f3363015eaec5303b Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Fri, 13 Nov 2020 23:35:34 -0500 Subject: [PATCH 10/16] Docs: fixed incorrect terragear URL in README.scenery --- Docs/README.scenery | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Docs/README.scenery b/Docs/README.scenery index 641526c0c..cc501e54a 100644 --- a/Docs/README.scenery +++ b/Docs/README.scenery @@ -194,9 +194,9 @@ is always the same and described in section 3.3. ---------------- specifies the terrain elevation data file. These files are generated with -the TerraGear tools (http://www.terragear.org/) and have file extension -".btg" ("binary terragear"; there used to be an "*.atg" file, too, where -the 'a' stood for ASCII). +the TerraGear tools (http://wiki.flightgear.org/TerraGear) and have file +extension ".btg" ("binary terragear"; there used to be an "*.atg" file, too, +where the 'a' stood for ASCII). Example: From 4a4e9089c10902055009cfe48cf24367b5a1069f Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Fri, 13 Nov 2020 23:38:47 -0500 Subject: [PATCH 11/16] Docs: fixed incorrect terragear URL in FlightGear-FAQ.html --- Docs/FlightGear-FAQ.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/FlightGear-FAQ.html b/Docs/FlightGear-FAQ.html index 65d6ac1b8..07272082f 100644 --- a/Docs/FlightGear-FAQ.html +++ b/Docs/FlightGear-FAQ.html @@ -840,7 +840,7 @@

Yes, though it can be a difficult task. FlightGear's scenery generation is handled by a sister project, TerraGear. For more details, see - http://terragear.org/.

+ http://wiki.flightgear.org/TerraGear.

From 2a303771245360d743b5b77f08c91bbe131165cc Mon Sep 17 00:00:00 2001 From: Stuart Buchanan Date: Sat, 21 Nov 2020 22:07:40 +0000 Subject: [PATCH 12/16] WS3.0: Remove Effect dependence on ALS. For the moment, as we have only one technique, stop it from only being active if ALS is active. --- Effects/ws30.eff | 1 - 1 file changed, 1 deletion(-) diff --git a/Effects/ws30.eff b/Effects/ws30.eff index 13302464b..14d3cbd25 100644 --- a/Effects/ws30.eff +++ b/Effects/ws30.eff @@ -409,7 +409,6 @@ - /sim/rendering/shaders/skydome 2.0 From 6db71f789cc3a188feda6e487fbcfa65e4734e21 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Sun, 22 Nov 2020 08:21:11 +0000 Subject: [PATCH 13/16] Added -h help text for --composite-viewer option. --- Translations/default/options.xml | 5 +++-- options.xml | 7 +++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Translations/default/options.xml b/Translations/default/options.xml index edddc3623..85381572f 100644 --- a/Translations/default/options.xml +++ b/Translations/default/options.xml @@ -11,13 +11,14 @@ General Options Show the most relevant command line options Show all command line options when combined with --help or -h - Use GUI launcher + Use GUI launcher + Enable CompositeViewer (extra view windows) Display the current FlightGear version Specify the root data path Specify the scenery path(s); Defaults to $FG_ROOT/Scenery Specify additional aircraft directory path(s) (alternatively, you can use --aircraft-dir to target a specific aircraft in a given directory) - Base directory to use for aircraft and scenery downloads (the TerraSync scenery directory may be specifically set with --terrasync-dir) + Base directory to use for aircraft and scenery downloads (the TerraSync scenery directory may be specifically set with --terrasync-dir) Select the language for this session Load recording of earlier flightgear session. If <name> ends with .fgtape it is interpreted as the recording's pathname; otherwise the recording's pathname is formed by prepending <name> with the tape directory and appending ".fgtape". Disable splash screen diff --git a/options.xml b/options.xml index 09daf4f47..cb2ba0011 100644 --- a/options.xml +++ b/options.xml @@ -58,6 +58,13 @@ + +