1
0
Fork 0
Commit graph

12164 commits

Author SHA1 Message Date
James Turner
c509744b0f Nasal: support for module reload via command
This won’t work for all modules, depending on what inter-dependencies
exist.
2022-11-08 22:38:04 +00:00
James Turner
6bb22caea2 PUI Compat: handle failed loads without crash 2022-11-08 22:38:04 +00:00
James Turner
c6ed57d04b Fix an occasional traffic crash 2022-11-08 22:38:04 +00:00
Stuart Buchanan
6d76b657d6 WS30 - remove separate water mesh option
No longer required now water shader integrated into
main ws30 shader.  Also clean up.
2022-11-08 21:47:41 +00:00
Florent Rougon
0deaec870a Adapt to SG 952d071c0 (SGSoundSample ctor now takes std::unique_ptr by value)
The aforementioned SG change[1] was done in line with Herb Sutter's
writing at [2] in order to clearly express sink semantics.

[1] 952d071c08/
[2] https://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters/
2022-11-08 14:34:24 +01:00
Florent Rougon
876330772b Navradio: fix regression and optimize older code
- Fix a little regression introduced in commit d2f4807fa2: changing
  the standby frequency disabled the low-pass filter for the next call
  to updateReceiver(); this must happen when the selected frequency is
  changed but not when the standby frequency is changed. This is covered
  by the recently-added unit test NavRadioTests::testVORSignalQuality.

- Optimization of the older code: no need to perform a navaid search()
  when only the standby frequency is changed.
2022-11-08 12:01:24 +01:00
Florent Rougon
d2f4807fa2 Navradio: disable low-pass filter when changing selected freq or leaving GPS slave mode
When the selected frequency is changed or when leaving GPS slave mode,
disable the low-pass filter applied to signal quality. Otherwise, the
following may happen for instance:
  - the active frequency corresponds to a navaid whose signal is well
    received;
  - user makes it so that the Morse code for the navaid ID can be heard;
  - user then changes the selected frequency to one that doesn't belong
    to a navaid that is close enough to be usable;
  - yet, as soon as the frequency is changed, the Morse code for the ID
    of the newly selected navaid (if any), even if it is way too far for
    its signal to be received, will be very clearly heard for about one
    second---and likely truncated.

This is because before this commit, after the frequency change, the
low-pass filter applied to signal quality made the code behave as if the
signal, supposedly coming from the new navaid, were still strong---which
of course doesn't correspond to physical reality. This fixes the bug
reported at [1].

[1] https://forum.flightgear.org/viewtopic.php?f=25&t=40890#p405708
2022-11-05 19:01:04 +01:00
Florent Rougon
1b5116fb32 Navradio: remove outdated comment 2022-11-05 19:01:04 +01:00
James Hogan
5645d0b558
Splash: Drop debug logging noise
Drop some unintentional debug logging noise from the sRGB support
detection code.
2022-11-05 17:31:53 +00:00
James Hogan
ab02bce279
CameraGroup: Fix missing splash on explicit camera setup
The splash window name was only being set for the default / legacy
camera setup, however if the camera group is set up explicitly in the
configuration XML the splash window wouldn't get set and the splash
would no longer get displayed.

This is fixed by selecting the first referenced window name from a
camera.

A better fix (more closely matching the prior behaviour) would be to
create a splash camera for each created window, however this is proving
difficult to test due to instability with multiple windows, so this fix
will suffice in the mean time.

Fixes: bb0d7fc0a7 ("src/Viewer: Move splash to cam group camera")
Reported-by: Durk Talsma <durktals@gmail.com>
2022-11-05 17:19:22 +00:00
Roman Ludwicki
fd0bb74a92 Replace displaying in Launcher --on-ground=false to --in-air for on final
The option`--on-ground=false` doesn't exist which can be misleading.
2022-10-26 21:52:40 +02:00
Stuart Buchanan
64ae52438b Fix uninitialized variable valgrind warning 2022-10-11 22:08:29 +01:00
James Turner
86f82994be Fix crash on METAR without cloud coverage set
As suggested by Scott, when a layer has no coverage set,
use the coverage of preceeding layer (lower down, closer to
the ground)

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2765/
2022-10-06 09:05:37 +01:00
James Turner
a7d13e0736 Fix missing untie in NewGui::shutdown 2022-09-30 09:36:20 +01:00
Florent Rougon
09ea80d12d FGSoundManager::playAudioSampleCommand(): update comment
The 'instant' queue doesn't work like other queues.
2022-09-26 16:00:19 +02:00
Erik Hofman
280fdecad0 Use a random string for a reference name so samples from the instant queue wich are using the same sound file will play simultaneously. 2022-09-25 10:16:12 +02:00
Erik Hofman
ee3ea86891 Tie the instant queue to the listener 2022-09-24 10:24:49 +02:00
James Turner
190d393cd2 Refactor graphics init to pass in the context 2022-09-22 11:39:15 +03:00
James Turner
e87e42e5fa Add an exception for a reported crash in Metar 2022-09-18 10:59:29 +02:00
James Turner
93cb7e1e93 Error reports: set context before loading FGFX
Set the relevant context property before loading FGFX, so fx-load 
errors are correctly attributed to the aircraft.
2022-09-12 13:31:57 +01:00
Erik Hofman
5acf2e26d0 Add a special queue-name 'instant' which does not put samples into a sample queue but plays them instantly. 2022-09-12 09:52:31 +02:00
Colin Geniet
5d6ac7a1c1 MP: Fix recurrent bool array compatibility issues
When FG encounters an unknown property id in a MP packet, it discards
the remainder of the packet. This happens when adding new MP properties:
older clients will discard the property and anything that comes after.
This is normally not an issue because newer properties are placed at the
end of the packet.

However MP bool array properties (sim/generic/bool[*]) are transmitted
at the very end of a packet, meaning they get broken (for backward
compatibility) each time a property is added to the protocol.

Fix this by placing them earlier in the packet, with the same ordering
rules as other properties.
2022-09-09 08:02:08 +01:00
Colin Geniet
e6327466e6 MP: Reorder new property for backward compatibility
Commit 6aff646cf (Mach number added to mode-S XPDR properties, 2022-07-20)
added /instrumentation/transponder/mach-number as a new MP property.

It was inserted with other transponder properties, in the middle of
the list of MP properties. This breaks backward compatibility:
older FG client discard any property after this.

Move the new property to the end of the list, with the largest id.
2022-09-09 08:02:08 +01:00
James Turner
97c7b6402e PUICompat: fix Nasal module for bindings 2022-09-09 08:01:13 +01:00
James Turner
745aef04ea Splash : restore macOS compatibility
Change to sRGB frame-buffer unfortunately broke macOS compatibility;
restore it by reverting to the internal format there.
2022-09-05 16:56:50 +01:00
James Turner
8b036f9353 GeneralInitOperation: guard against duplicate calls 2022-09-05 12:53:40 +01:00
James Turner
e5aee5adf6 open-browser: always prefix paths with file://
Make opening a local file explicit as a URI, on all platforms (before,
this was only done on macOS)
2022-09-05 12:53:21 +01:00
James Hogan
91ddbf6a7c
VRManager: Fix crash on exit on Windows
VRManager::instance() was using a function scoped static osg::ref_ptr to
store the VRManager instance. However it needs to be used from
fgOSCloseWindow(), which is called from an atexit handler, and C++11
specifies that static object destruction and atexit handlers are reverse
sequenced, i.e. a static object initialised after an atexit call will be
destroyed before the atexit callback is called.

On Windows this can result in the osg::ref_ptr being destroyed (and
hence set to NULL) before fgOSCloseWindow() tries to call
destroyAndWait() on the instance.

Fix the resulting seg fault by moving the ref_ptr object to static file
scope so it is default constructed before the atexit call, and using
only a simple static bool to initialise it on first call to
VRManager::instance().

Reported-by: Alan Teeder <ajteeder@v-twin.org.uk>
2022-08-29 22:06:49 +01:00
portree_kid
e85e5d2e5b AI
* Parking on parking with right heading
* Leg 6 Descent improved (teardrop like entry)
* Inner/Outer tangents in VectorMath TODO Move to SG
2022-08-29 21:05:49 +02:00
Florent Rougon
3ee54cbd72 Revert "Call fgInitAllowedPaths() also in fgInitConfig()"
This reverts commit e7594f4687.
2022-08-28 11:49:37 +02:00
Florent Rougon
896be707ae Revert "Call fgInitAllowedPaths() between updates of aircraft paths and -set.xml parsing"
This reverts commit 9fc5f30a93.
2022-08-28 11:49:30 +02:00
Florent Rougon
9fc5f30a93 Call fgInitAllowedPaths() between updates of aircraft paths and -set.xml parsing
fgInitAircraft() loads the aircraft -set.xml file, which calls
ResourceManager::findPath() for each 'include=...' directive. In order
to prevent such includes from triggering the new warning printed by
ResourceManager::findPath(), call fgInitAllowedPaths() after the
aircraft paths have been updated and before the -set.xml file is loaded.
Thanks to Alan Teeder for reporting the problem.

We can now probably remove the call to fgInitAllowedPaths() after
processOptions() in fgStartNewReset() (I believe the newly-added call
comes “soon enough”). Not doing so in this commit, though: let's fix
problems before optimizing.
2022-08-27 20:01:55 +02:00
Florent Rougon
563bc4775f Minor changes
Fix a typo and a warning about an unused variable.
2022-08-24 15:14:57 +02:00
Florent Rougon
e7594f4687 Call fgInitAllowedPaths() also in fgInitConfig()
This is an additional call to fgInitAllowedPaths(), earlier than the
normal one. It doesn't know the paths given to --allow-nasal-read, but
can already authorize read access for all of $FG_ROOT. This allows one
to add SGPath::validate() checks for paths given to
ResourceManager::findPath() with a non-null second argument (without
this change, the validation would fail for files included from
defaults.xml, read by fgSetDefaults() before the definitive
fgInitAllowedPaths() call has been performed).
2022-08-24 01:31:39 +02:00
Florent Rougon
36dd57f6f4 Don't look for the splash screen font in the aircraft dir
The previous way only worked because after trying
SGPath(aContext, aResource), ResourceManager::findPath() tries all
providers, among which there is a BasePathProvider with $FG_ROOT as its
base... provider which doesn't use the 'aContext' argument at all.
2022-08-24 01:31:04 +02:00
Florent Rougon
ee12883eb6 Replace fgValidatePath() with SGPath::validate()
Move the fgValidatePath() code and the two associated static variables
'read_allowed_paths' and 'write_allowed_paths' to SimGear.
fgValidatePath() is now known as SGPath::validate(). This requires
SimGear commit e002a481f481709263a.
2022-08-22 13:35:15 +02:00
James Hogan
199adf90df
VRManager: Update to osgXR 0.5.0
osgXR 0.5.0 broke the API slightly, so update VRManager to use the new
enumeration names and update the required osgXR version for when using a
system version of osgXR.

Signed-off-by: James Hogan <james@albanarts.com>
2022-08-21 17:55:18 +01:00
Florent Rougon
60ff405efc FGSoundManager: fix path handling in playAudioSampleCommand()
- Use the complete path when performing the existence check (previously,
  only the directory part was used: bug in commit
  8853fded29).

- Use the resolved path (SGPath instance) obtained from
  FGGlobals::resolve_maybe_aircraft_path() when constructing the
  SGSoundSample instance; this makes it possible to use paths starting
  with the '[addon=...]' special prefix (handled by the
  AddonResourceProvider) with FGSoundManager::playAudioSampleCommand(),
  and therefore with the 'play-audio-sample' FGCommand.

This requires SimGear commit 8febf6b9f58e9a1919ff3 ("SGSoundSample
constructor changes").
2022-08-20 08:27:45 +02:00
Florent Rougon
a502de9e81 FGPUIMenuBar: small optimization (requires C++17) 2022-08-18 17:39:08 +02:00
Florent Rougon
afe7d996af FGPUIMenuBar: fix bug when several menu entries have the same label
Before this commit, if several menu entries (possibly in different
menus) had the same label after translation and latin1-ization by
FGLocale::utf8toLatin1(), selecting one of them used to fire the
bindings associated to all such entries. This is because the bindings
used to be stored in an std::map whose keys were the
translated-and-latin1-ized labels.

This commit fixes the problem in the following way:
  - the std::map (_bindings) is turned into an std::forward_list;
  - each element of this std::forward_list references the bindings
    assigned to a menu entry;
  - in order to allow FGPUIMenuBar::fireItem() to find the bindings
    assigned to the menu entry that triggered it,
    FGPUIMenuBar::make_menu() calls puMenuBar::add_submenu() with an
    additional argument ("user data") that attaches to the puObject for
    each menu entry a pointer to the relevant element of _bindings.

Note: given how the menubar is created, an std::vector wouldn't be
appropriate for _bindings, because we need the pointers to its elements
to be stable when new elements are added to _bindings.

Reported by Wayne Bragg: https://sourceforge.net/p/flightgear/mailman/message/37682605/
2022-07-27 00:30:12 +02:00
Michael Filhol
6aff646cfa Mach number added to mode-S XPDR properties, exposed to MP (for ATC). 2022-07-26 10:30:14 +01:00
James Hogan
dc5404a3c2
FGButton: Make init()'s "module" parameter const
FGButton::init() passes the module parameter (a non-const string
reference) straight through to FGCommonInput::read_bindings() as a const
reference.

Change the FGButton::init() signature so that module is const there too,
so that callers can pass it const string references returned by
accessors without having to make copies.
2022-07-13 23:46:23 +01:00
James Hogan
b9efba55e7
src/Viewer/splash: VR splash screen
Use a quad composition layer object from osgXR 0.3.9 to make the splash
screen VR friendly. This allows the OpenXR compositor to redraw the quad
without any updates from flightgear, which is particularly helpful as
flightgear makes no attempt at a reasonable VR frame rate during
initialisation.

The quad is positioned 2 meters from the user, with an aspect ratio
matching the desktop window. The quad is blended using an
unpremultiplied alpha channel which is forced to a given alpha value by
osgXR.

The splash is effectively already rendered to an FBO as non-linear SRGB,
so this is made explicit in the internal texture format, with the
rendering to the desktop window using GL_FRAMEBUFFER_SRGB to ensure it
is properly re-encoded.
2022-07-12 22:38:53 +01:00
James Hogan
bb0d7fc0a7
src/Viewer: Move splash to cam group camera
Move the splash screen from the scene root to a camera group camera,
just below the GUI camera. This has a number of advantages, mainly VR
related:
 - The splash FBO will only be rendered once per frame. Currently it
   appears to be rendered for both near & far cameras, and with
   stereoscopic rendering for both left & right (even though it splats
   right across both views at the moment), so 2 or 4 times.
 - It makes it possible to render the splash fullscreen on the desktop
   window, while presenting it on a 3d quad in VR (possibly via an
   OpenXR composition layer so the runtime can keep rendering it
   smoothly while FlightGear framerate drops during loading.
2022-07-12 22:38:53 +01:00
portree_kid
ce7b5eb094 AI Aircraft not taking off because TowerController signOff was not called. 2022-06-20 21:32:52 +02:00
portree_kid
5a3528f782 Fix segfaults in AI code 2022-06-19 10:28:54 +02:00
James Turner
a46d71930a Launcher: add settings for TerraSync DNS
Add advanced settings to speciofy the TerraSync DNS server.
This shoud allow some work-around of problems with some
ISP DNS.
2022-06-07 23:17:13 +01:00
Julian Smith
28d7308985 src/Viewer/viewmgr.*: fixed bug when /sim/aircraft contains '.' chars.
We were not appending the video container suffix if there was already a '.' in
the name.

Part of this fix is also to simplify the code - if name_in is not "" we don't
attempt to create softlink or append /sim/video/container.
2022-06-05 19:43:46 +01:00
James Turner
55c9c61fc3 Launcher: add logging around aircraft installs
Trying to understand ‘aircraft not found’ errors around packaged
aircraft
2022-06-01 11:50:38 +01:00
James Turner
8517eda0c9 Ground-cache: throw on NaN inputs
Attempt to provoke FDM NAN issues more directly (eg in Sentry reports),
rather than waiting on SGCardToGeod, etc to blow up inside the
ground cache.

SF-Id: https://sourceforge.net/p/flightgear/codetickets/2743/
2022-06-01 11:50:38 +01:00
portree_kid
d571bc6f76 AI Improvements
* Parking with point beyond parking so aircraft don't stop early
* Better approach routes (wait pattern)
* Extracting vector math from AIFlightplan
* More use of SGPositioned in ATC
2022-05-31 21:23:34 +02:00
James Turner
dbe2734e2c Launcher and startup support for TACANs
The launcher diagram and navaid-search now include TACANs, using
the current NavCache encoding (DME whose name ends in TACAN). A new
‘—tacan’ option works similar to —vor etc to set position (with 
optional offset). 

Tuning the Tacan instrument from the command line is not yet supported,
but could be easily added.
2022-05-31 10:18:16 +01:00
James Turner
43e0b3be48 CMake: fix missing header
Original fix by Mariusz Matuszek, adapted by me.
2022-05-25 11:16:44 +01:00
Lars Toenning
71c92c754d Remove FGMakeUpperCase listener
After discussing the problems, it was decided to remove this feature (https://sourceforge.net/p/flightgear/flightgear/merge-requests/295/).
2022-05-25 11:03:52 +01:00
James Turner
7d78c40086 Remove upper-casing of route-manager input
upper_case_property causes valueChanged to fire twice, since
SGPropertyNode string storage is now immutable (std::string). This
caused double-processing of for example adding a waypoint in
the route-manager dialog. Since the InputListener already upper-cases
the string, we can simply remove the upper-case property logic.
2022-05-25 10:43:08 +01:00
Lars Toenning
5051d90487 Use std::function for callbacks 2022-05-25 10:38:20 +01:00
James Turner
fb36cea04c Skip NasalClipboard on test-suite builds
Ticket: https://sourceforge.net/p/flightgear/codetickets/2740/
2022-05-17 14:33:35 +01:00
James Turner
3f670c84b1 VSCode applied formatting. 2022-05-16 12:15:05 +01:00
James Turner
15cb5ab075 Fix Windows: include needed for getpid() 2022-05-16 12:14:13 +01:00
James Turner
0df1109d93 Fix warnings / breakage from previous change. 2022-05-11 21:24:37 +01:00
Lars Toenning
961c57b576 Add missing include
Fixes compilation for GCC 12.1
2022-05-11 13:04:11 +01:00
PlayeRom
446299ddaf Fix using SI units like speed in km/h and altitude in meters for flight plan in Launcher. 2022-05-10 16:40:06 +01:00
Julian Smith
6edf68107e src/FDM/YASim/Gear.cpp: use SG_LOG instead of assert fail if contact is incorrect.
Have seen the assert fail when resetting location.
2022-05-08 12:58:58 +01:00
Julian Smith
b40cc51611 src/Viewer/viewmgr.cxx: log video encoding sws_scale() timing info with /sim/video/log_sws_scale_stats. 2022-05-01 15:28:01 +01:00
Julian Smith
d2d3bd5edc src/Viewer/: crude control over thread-cpu affinities on linux.
Detects /sim/affinity-control being set to 'clear' and 'revert' and modifies
all thread affinities accordingly. Only active on Linux.

Also modified meaning of /sim/thread-cpu-affinity. Instead of true/false, we now
expect these values:

    '': do nothing.

    'none': tell OSG to not set up any thread affinities (same as prev
    'false').

    'osg': allow OSG to set up thread affinities but attempt to cancel affinity
    of main thread afterwards.
2022-05-01 15:24:38 +01:00
Julian Smith
a59c94f8be src/Viewer/renderer.cxx: use /sim/thread-cpu-affinity to control thread-cpu affinity.
This is for investigating bug 2734.

If /sim/thread-cpu-affinity is true or unset on startup, we use default
behaviour where we tell OSG to set up thread-cpu affinities.

Setting /sim/thread-cpu-affinity to false on start up results in all/most
threads being free to run on any cpu core. For example in .fgfsrc or on
command, use:

    --prop:bool:/sim/thread-cpu-affinity=false
2022-04-30 00:14:00 +01:00
Erik Hofman
0923400e35 Expose the machwave active and offset properties 2022-04-29 15:08:10 +02:00
Bertrand Coconnier
60ce826874 Sync'ed with JSBSim v1.1.11
- Output files are now written in the current directory instead of being written in the aircraft folder (issue GH#337)
- A new exception TrimFailureException is now thrown when trim fails. This eases the detection of the trim failure (previously the exception message needed to be checked).
- An exception is thrown when a latitude higher than 90 degrees is supplied to a <waypoint> control element (PR GH#536)
- Fix the sign of the initial NED climb rate (property ic/gamma-deg) (PR #545)
- JSBSim now checks malformed data in <table> elements. Anything different than numbers and spaces/tabs will be rejected.
- Usage of <location> and <orientation> in engines is now officially dropped (PR #559, #561 and #563). These elements were deprecated long ago in favor of the corresponding elements <location> and <orientation> in thrusters. Therefore the code removed is no-op.
- The computation of the initial rotation rates has been fixed (Issue GH#553). Previously, the rotation rates could be initialized with extremely high values when the vehicle was spawned over the Poles. And for a given set of initial conditions, the initial rotation rates could have different values depending on the initial latitude at which the vehicle was initialized. This now fixed.
- The precision with which values are transmitted thru a socket can now be set via the attribute precision such as <output precision="8"> (PR GH#579)
- Added 2 new methods to FGFDMExec: SetOutputPath and GetOutputPath to specify the path to which the output files will be written.
- All JSBSim exceptions now inherit from JSBSim::BaseException. There still exist std::* exceptions thrown by JSBSim. Cleanup is still in progress.
- JSBSim no longer calls exit() or abort(). Exceptions are thrown instead. This gives the calling application an opportunity to gracefully recover.
2022-04-23 19:18:42 +02:00
James Turner
06063ed82a Fixes for Wake turbulence changes
- add missing <string> include
- fix tests
2022-04-20 10:23:31 +01:00
Bertrand Coconnier
83cad5797e Intercept errors in the matrix inversion routine and report the faulty aircraft in the log. 2022-04-16 13:45:10 +02:00
Bertrand Coconnier
3441c5ef3a Remove floats equality test with zero and fix memory leaks. 2022-04-16 13:26:17 +02:00
Lars Toenning
2ccd9bfb30 [swift] Pass struct to updatePlanes() instead of multiple vectors 2022-04-06 07:53:51 +01:00
Lars Toenning
e35c24af99 Update swift license headers 2022-04-06 07:53:51 +01:00
Lars Toenning
9ec7d6b855 swift cleanup 2022-04-06 07:53:51 +01:00
James Turner
7a0be3f000 GUICompat: fix binding activation, close callback
With this change, binding can be activated mostly-correctly from
the compatability layer. Closing still isn't working quite right, more
changes to follow.
2022-03-24 10:36:06 +00:00
James Turner
abb394935d Use type-safe subsystem access 2022-03-24 10:34:12 +00:00
James Turner
a9e09a0ae4 Remove obsolete pre-OSG 3.4 code 2022-03-24 10:34:04 +00:00
Julian Smith
da946fb14c src/FDM/YASim/FGFDM.cpp: allow backwards compatibility of gear contact points/surfaces.
We now allow an aircraft to specify both simple gear contact points (which will
be automatically used by old Flightgear builds), and also gear contact surfaces
(which will be automatically used by new Flightgear builds).

When parsing gear specifications, if specified we now use 'wheel-x', 'wheel-y'
and 'wheel-z' in preference to 'x', 'y' and 'z' for the wheel centre point.

These new 'wheel-*' values will be ignored by old Flightgear builds.

So to work with both old and new Flightgear builds, an aircraft should specify
old-style contact points with 'x', 'y' and 'z' as before, and new-style contact
surfaces with 'wheel-x', 'wheel-y' and 'wheel-z', and 'wheel-radius' and
'tyre-radius'.
2022-03-21 15:31:08 +00:00
Julian Smith
5fb8c39057 src/FDM/YASim/YASim.cxx: add gear[]/spring and gear[]/damping properties. 2022-03-21 15:31:08 +00:00
Julian Smith
011b1cc726 src/FDM/YASim/: added support for torus-shaped gear contact surface.
Contact surface can now be a torus shaped tyre; we find the part of this torus
that is furthest towards the ground instead of using a fixed contact point.

Torus is specified by radius of wheel centred on original contact point,
orientation of a wheel axle, and radius of torus. If both wheel and tyre radius
are both zero the calculations reduce to a fixed contact point as before.

src/FDM/YASim/FGFDM.cpp
    Read new optional <gear> attributes:
        wheel-axle-x
        wheel-axle-y
        wheel-axle-z
        wheel-radius
        tyre-radius

src/FDM/YASim/Gear.cpp
    Added new gearCompression() function that calculates gear compression for
    wheel with torus tyre. If new radius values are both zero the calculation
    behaves like a contact point as before; we also optimse this case to avoid
    the extra matrix operations.

    Moved old algorithm into gearCompressionOld() function to allow testing
    that new algorithm gives same results when wheel and tyre have zero radius.

src/FDM/YASim/Gear.hpp
    Added new members:
        _wheelAxle,
        _wheelRadius
        _tyreRadius
    Also declare gearCompression() function so it is available for unit
    testing.

    Added GearVector struct for caching unit vector and magnitude and use for
    _compr and _wheelAxle, so we avoid having to calculate magnitude and unit
    vector each iteration.

    Clarified that _compressDist is vertical movement of gear. Not useful for
    gear animations - one must use compression-norm.

src/FDM/YASim/Airplane.cpp
src/FDM/YASim/Model.cpp
src/FDM/YASim/YASim.cxx
    Use g->getContact() instead of manually adding compression vector to
    g->getPosition() (which no longer gives the correct contact point).
2022-03-19 23:14:58 +00:00
Julian Smith
417332f265 src/FDM/YASim/yasim-test.cpp: Minor improvements to help text. 2022-03-19 23:14:58 +00:00
Julian Smith
04ee8d95f5 src/Viewer/splash.cxx: added some missing braces for clarity. 2022-03-19 23:14:58 +00:00
Richard Harrison
662dad0848 Fix MP Pilot List disappearing
Ensure that lag/lag-mod-averaged is created and set to a valid value (0) prior to calling the base class init method as otherwise the MPList will have a nil reference.

This needs to be done prior to the base class ::init() because that method sets the model-added property which will trigger the lisetener.
2022-03-17 11:51:52 +01:00
Richard Harrison
360c64c7b7 Remove threaded Nasal garbage collection refs #2674 Nasal corruption:
refs: https://sourceforge.net/p/flightgear/codetickets/2674/

Because disabling threaded GC wouldn't result in exactly the same allocation and GC due to changes I made to the GC as part of the threaded GC work the only safe thing to do is to remove it all.

Once we have figured out if it is the threaded GC causing the problem or not then we will at least know what needs fixing.
2022-03-13 21:37:42 +01:00
Richard Harrison
d678d108ce Splash: add visibility condition to images
Using a <condition> images can be hidden now.

Also reworked the logic so that any hidden item will be hidden from creation and not rely on the update logic; as otherwise items can momentarily appear.
2022-03-11 18:38:24 +01:00
James Turner
b91b6c4516 Fix Camera ownership for GUI-Manager
We can't assume the default/primary Camera for the View, is the GUI
camera, so add explicit setting to get tooltips and popups working
again.
2022-03-11 12:50:08 +00:00
Richard Harrison
5db4b5c871 Splash-logo fixes for max-width and position
PC9-M looked wrong; reported by Erik
2022-03-10 20:21:17 +01:00
Richard Harrison
bc9291cb02 Splash: fix logic for nightly build.
I thought it would be right to display a nightly build warning for self build also - but now I've changed my mind as it is an irrelevance.
2022-03-10 15:54:29 +01:00
Richard Harrison
e3c2a39420 Define splash screen from property tree
Refactor Splash to be data drive using definitions in <content> for the system splash and <model-content> for model related content.

All system splash is at fixed index and should not be changed except for good reason.
2022-03-10 15:12:34 +01:00
Richard Harrison
de41907532 Use helper method for OSGText alignment mapAlignment 2022-03-10 15:12:34 +01:00
James Turner
4e6f9e6239 Nasal startup: allow more control over loading
Allow excluding scripts entirely based on the startup load properties.
2022-03-09 16:52:19 +00:00
James Turner
0e079a7ebe More #ifdefs around PUI in the UI code 2022-03-09 16:52:19 +00:00
James Turner
7613cb3ce7 Canvas GUIMgr: remove coupling on FGRenderer 2022-03-09 16:52:19 +00:00
James Turner
52731a7c04 Nasal: expose Canvas SpaceItem directly
Allow a SpacerItem to be explicitly created.
2022-03-09 16:52:19 +00:00
James Turner
77501672df Nasal expose propertyValue as a helper
Allow other code to map property values to an naRef, without exposing
the generic property node on their API. This avoids creating a wrapper
props.Node frequently for simple value access.
2022-03-09 16:52:19 +00:00
James Turner
cbd5ef9e7b GUI: XML to Nasal bridge, to keep PUI dialogs working
(Disabled by a CMake option)

This builds equivalent C++ objects to what the PUI dialogs build, with
properties exposed to Nasal. Peer objects are created by Nasal callbacks,
which can implement the various dialog functions needed to keep
compatibility, especially the ‘update’ and ‘apply’ hooks.
2022-03-09 16:52:19 +00:00
James Turner
5e0cb1b6e3 Remove some obsolete startup log messages 2022-03-09 16:52:19 +00:00
James Turner
e1cc22090d C++: use override in CanvasSystemAdapter header 2022-03-09 16:52:19 +00:00
James Turner
79f38a5742 Expose new GridLayout to Nasal
Requires up-to-date SimGear which includes the new header.
2022-03-09 16:52:19 +00:00
James Turner
a324ba4b41 Multiplayer: use standard position accessors
Replace manual property query with the standard position
accessors from FGGlobals.
2022-02-26 17:43:15 +00:00