1
0
Fork 0
Commit graph

15918 commits

Author SHA1 Message Date
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
3b40f704fd Add swift unittests 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
26695b448c test_suite/unit_tests/FDM/CMakeLists.txt: fixed incorrect header name. 2022-03-20 12:46:11 +00:00
Julian Smith
683501e3bd test_suite/unit_tests/FDM/: added test of new YASim torus gear system.
test_suite/unit_tests/FDM/CMakeLists.txt
test_suite/unit_tests/FDM/TestSuite.cxx
test_suite/unit_tests/FDM/yasim-gear.cxx
test_suite/unit_tests/FDM/yasim-gear.hxx
    E.g. run test suite with: -u YASimGearTests::test
2022-03-19 23:14:58 +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
James Turner
1ec67f05ff Multiplayer: ensure lag/ properties always exist
Create lag/foo properties used by the Pilot-list UI in bind(). This avoids
a race condition where motion info was not yet updated, but Nasal tries
to retrieve the lag properties and errors out.
2022-02-26 17:43:15 +00:00
James Turner
3fb81a34f5 Launcher: Add altenrate UI style file
Keep forgetitng to add this, commiting so it
doesn't get lost in the shuffle.
2022-02-26 17:43:15 +00:00
James Turner
16bf10b333 Avoid Marker-beacon spam on FDM NaN case
Check and bail out of marker beacon search if we are in NaN-land; this
should making it easier to trace the cause of the NaNs.
2022-02-20 16:20:04 +02:00
Julian Smith
076d0816b5 src/Aircraft/replay-internal.cxx: removed stray diagnostic in prev commit. 2022-02-19 12:41:21 +00:00
Julian Smith
2d53280fba src/Aircraft/replay-internal.cxx: fix replay of some legacy normal recordings.
Flightgear 2020.3 releases use a different encoding for multiplayer information
in Normal recordings (these are saved from in-memory recording data), which
we failed to parse. This commit restores handling of this encoding, enabling
replay of older recordings.

Also when replaying in-memory recording, don't do background in-memory record
of multiplayer information, because this gradually prunes the information that
is being replayed.
2022-02-19 12:03:56 +00:00
portree_kid
b216658ba1 AI improved entry into parking (heading and postition) 2022-02-13 20:34:17 +01:00
portree_kid
49eeb6627c Fix compile issue 2022-02-12 19:49:21 +01:00
Torsten Dreyer
0e0acc9a10 Fix a memory leak 2022-02-11 08:50:13 +01:00
James Turner
f8afde7528 Yasim-test: add detailed lift/drag graphing
Patch by Huntley Palmer, to extend range of recorded angles, and
offer a detailed mode with finer resolution over a specific range.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2629/
2022-02-07 11:42:28 +00:00
portree_kid
82863d3f3e AI Fixes
* Fix turns (left-turn-bug)
* Better parking apporach
* CSV Logging via property
* ft vs m bug in setLeadDistance
* Split Runway Entry/Exit calculation
* Prototype wait pattern
2022-02-06 21:11:58 +01:00
PortreeKid
cacd650f27 Remove Traffic Tests 2022-02-05 13:33:42 +01:00
Julian Smith
da7434f2e2 src/GUI/Highlight.cxx: fixed bug in FdmInitialisedListener destructor.
Use m_fdm_initialised to unregister our listener, as it waill always be valid,
unlike globals->get_props()->getNode(...).
2022-02-02 15:25:07 +00:00
b'Keith Paterson
f2d05e33e3 Merge /u/portree_kid/flightgear-portreekid/ branch topics/atc/clean_inheritance into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/288/
2022-02-01 19:29:30 +00:00
Stuart Buchanan
8bbb30225f WS30: Add property controlling splitting water mesh 2022-02-01 16:48:54 +00:00
Stuart Buchanan
13fab25b6f MR273 - Added the Milky Way onto the night sky
from Chris RINGEVAL

https://sourceforge.net/p/flightgear/flightgear/merge-requests/273/

Squashed commit of the following:

commit ea6e808e418533db1a41671c67a7873ddbfcc858
Author: Gonzalo Pesquero <gpesquero@yahoo.es>
Date:   Sun Nov 21 17:44:44 2021 +0100

    Add translations on splash screen

commit 3c47d771877743692f5d0d63e980d6694a549405
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Sat Nov 27 16:37:31 2021 +0100

    Moon direction vector in the eye frame available to shaders

commit 70728f7ea29dad75c34cad69745021ee927bea31
Author: Chris Ringeval <eatdirt@protonmail.com>
Date:   Sun Nov 21 22:18:38 2021 +0100

    Add altitude to scolor object as needed by Milky Way texturing
2022-02-01 16:23:07 +00:00
portree_kid
cf0d90ef3d Cleanup Inheritance in ATC 2022-01-31 22:34:05 +01:00
James Hogan
276835f74c
osgXR: Update to 0.3.8
Update 3rdparty/osgXR to version 0.3.8, which gets us non-linear sRGB
swapchain formats by default. This avoids double gamma correction with
Monado when FlightGear renders non-linear sRGB data into linear RGB
swapchain images.
2022-01-30 21:29:06 +00:00