1
0
Fork 0
Commit graph

15008 commits

Author SHA1 Message Date
James Turner
0e545d711c Attempt to handle NaNs more elegantly
Check for NaNs after each FDM iteration, and freeze the sim if found.
Report this condition to the user and to the reporting backend, along
with the last valid position.

Probably needs some refinement, this is just a first guess.

Sentry-Id: FLIGHTGEAR-AM
2020-12-18 13:58:33 +00:00
James Turner
4f7d84ed73 Avoid crash when OSG event context is nil
Seems to relate to certain window managers and focus policies.

Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2218/
Sentry-Id: FLIGHTGEAR-30J
2020-12-18 12:17:42 +00:00
James Turner
fe17cfc84d Fix a crash on macOS if a joystick fails to open 2020-12-17 13:53:00 +00:00
James Turner
a092902483 If loading plain text route, check for an XML header
Avoids errors when we try to parse an XML file as plain text.

Sentry-Id: FLIGHTGEAR-J6
2020-12-17 10:51:07 +00:00
James Turner
d7155bde38 Attempting to fix crash with the Wright-flyer
Some users crash in the UIUC code during init; this change is to try
to understand why.

Sentry-Id: FLIGHTGEAR-SA
2020-12-17 10:51:07 +00:00
Fernando García Liñán
ae41eba3da Support reloading Compositor instances at runtime via a fgcommand 2020-12-17 06:36:25 +01:00
Scott Giese
1781bebb12 Easy rpath solution.
Supported for UNIX-like (excluding Apple, Cygwin).
2020-12-16 23:34:59 -06:00
Julian Smith
d04c1a00f2 src/Canvas/canvas_mgr.cxx: fix for segv in simgear unit tests.
Make CanvasMgr::init() not attempt to call flightgear::getGUICamera() if
there's no default camera set up yet.
2020-12-16 21:19:01 +00:00
Florent Rougon
e342a0f41e terrasync.py: add support for the HTTPS protocol
- Instantiate an HTTPSConnection object when the URL scheme is 'https'.

- Clarify and simplify the initialization of HTTPSocketRequest and
  HTTPDownloadRequest:
    + clarify initialization of their 'callback' attribute (it's the
      method of the same name; make it clear that the base class
      constructor, namely HTTPGetCallback.__init__(), doesn't modify the
      'callback' attribute when an object of class HTTPSocketRequest or
      HTTPDownloadRequest is initialized);
    + HTTPDownloadRequest doesn't need access to the TerraSync object
      -> remove the corresponding instance attribute and constructor
         argument.

- Don't use super() when initializing HTTPDownloadRequest objects
  (see [1]).

[1] https://fuhm.net/super-harmful/
2020-12-15 15:40:40 +01:00
James Turner
62cdd30810 Fix a GPS bug identified by Jonathan Redpath
When in LEG mode, and within the intercept cone, but further away from
the leg waypoint than the leg origin, we were computing a bogus
abeam point and hence a bogus desired track.

Detect this situation, and invert the computed along-track-distance,
so the computed abeam point is actually near where we are, and not ahead
of us.
2020-12-14 21:04:50 +00:00
James Turner
c588f90a59 GPS: Extend a unit-test slightly 2020-12-14 13:03:57 +00:00
James Turner
7a3f8276a6 Add unit-tests for Route-manager commands
Fix some bugs in insert-waypt command discovered during the testing
(w00t, tests FTW)
2020-12-14 11:45:46 +00:00
James Turner
72f1b84837 Improve waypointFromString logic
- exclude POIs and some other types from the ident match, to avoid
  confusing results
- improve how the search vicinity is computed when inserting a leg,
  which is the common case for a route with a destination set. Use
  the midpoint of the leg ending at the insert position, as the optimal
  search vicinity
- move the waypointFromString code into route.cxx, since it is mostly
  independent of a FlightPlan instance
- extend the tests to cover the bug which flagged these issues

Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2372/
2020-12-13 17:55:32 +00:00
Scott Giese
b7fa7e2c1c Revert "Fix textNasalSys"
This reverts commit eabd4bbc7f.
2020-12-13 09:17:11 -06:00
James Turner
a25902e2a3 macOS: update ICNS file
Add SVG source icon created by Michael Danilov, and an SVG to ICNS
conversion script from GitHub which generates all the resolutions
and sizes nicely.
2020-12-12 16:39:04 +00:00
James Turner
b2622458cc Autopilot: tolerate whitespace in XML strings
Prevent errors from property code when leading / trailing whitespace
occurs in the autopilot XML, in a property path. Use strutils::strip
to remove whitespace.

Ticket-Id: https://sourceforge.net/p/flightgear/codetickets/2445/
2020-12-12 16:39:04 +00:00
Julian Smith
988e377ec9 Improved Sview system to allow specification of views from Nasal using properties.
SviewCreate() now takes a SGPropertyNode* config which contains all information
needed to specify the view, including window size and position.

By default views are defined using a series of <step>...</step> nodes which map
to SviewStep* classes internally.

Alternatively, existing extra-view functionality is supported using
type='current', 'last_pair' or 'last_pair_double', plus one can use old-style
<view>...<view> nodes with type='legacy'.

See src/Viewer/sview.hxx for details and examples.

The extra-view commands view-clone, view-last-pair and view-last-pair-double
now pass the supplied SGPropertyNode* through the underlying FGViewMgr to
SviewCreate().

Improved handling of +/- heading and pitch values. For example some legacy
views have inverse relationship between heading-offset-deg and the actual
heading offset, so we now only multiply by -1 early on when handling these
legacy views, and SviewStepRotate does not negate.

Fixed Helicopter view direction bug with multiplayer aircraft - need to use
global /sim/current-view/heading-offset-deg, even for multiplayer aircraft.

Fixed incorrect handling of roll in pilot view - when adding in extra changes
of heading, pitch and roll to things like Helicopter view, simply adding to
heading, pitch and roll doesn't work if aircraft roll is not zero. Instead we
need to do the calculation with SGQuatd, so have added optional rotation params
to SviewStepFinal.

Added support for legacy Tower view look from.

Details:

    src/Main/fg_commands.cxx
    src/Viewer/viewmgr.cxx
    src/Viewer/viewmgr.hxx

        Added 'view-new' command.

        All recently-added view commands now pass the SGPropertyNode* arg to
        globals->get_viewmgr() and from there to SviewCreate().

    src/Viewer/sview.cxx
    src/Viewer/sview.hxx

        SviewStepAircraft and SviewStepNearestTower uses new Callsign
        class for tracking multiplayer aircraft by callsign instead of
        /ai/models/multiplayer[] number, so we cope when multiplayer aircraft
        are renumbered by network outages.

        Double views are now implemented as a final view step, instead of
        in a separate class derived from SviewView. So all views are
        implemented using SviewViewEyeTarget, and there is arguably no
        need for the separate SviewView base class.

        SviewViewEyeTarget now has a single list of steps, instead of separate
        lists for eye and target, because the use of SviewStepCopyToTarget makes
        separate lists unnecessary.
2020-12-12 14:09:39 +00:00
Julian Smith
e7e2895573 src/Model/modelmgr.cxx: fixed minor clang warning about indentation. 2020-12-12 14:09:39 +00:00
Stuart Buchanan
b35eb24ca5 WS30: Improved material atlas
Add
- texture size
- shininess
- diffuse
- specular

from material.xml into the fragment shader via sampler1D.
2020-12-08 21:13:35 +00:00
Fernando García Liñán
017bb8a042 Do not change the near/far values of the GUI camera 2020-12-08 15:02:13 +01:00
Fernando García Liñán
d95964071d Better handling of near/far values in multiple camera setups 2020-12-08 14:10:24 +01:00
Erik Hofman
86befa6e5e Why on earth didn't the compiler get this error? 2020-12-08 09:55:53 +01:00
Erik Hofman
2d652adddc Fix a stupid off by one mistake 2020-12-08 09:47:22 +01:00
Erik Hofman
6baae3e00b Do not exceed the maximum climate code 2020-12-08 09:36:01 +01:00
James Turner
b61d189071 Add more bootstrap logging for Win7 weirdness 2020-12-07 17:11:17 +00:00
James Turner
7aa160c4e3 Write max-texture-units to properties 2020-12-07 17:11:17 +00:00
James Turner
83c8c7e0c3 RunwayPrefs: fix an edge case (at KORD)
If we reject all preferences due to missing runways, don’t end up
with un-initialized values.
2020-12-07 17:11:17 +00:00
Erik Hofman
e9e1607fce Fix a possble buffer overflow due to a rounding error 2020-12-07 15:10:20 +01:00
Julian Smith
d0db698c7b Correct any positive value of user and multiplayer chase-distance-m.
Chase distances are supposed to be negative. Otherwise in external views
vertical mouse moves have reversed behaviour when changing view angle. E.g.
see:

    https://sourceforge.net/p/flightgear/codetickets/2454

src/MultiPlayer/multiplaymgr.cxx
    Fix +ve chase-distance-m for multiplayer aircraft.
src/Viewer/viewmgr.cxx
    Fix +ve chase-distance-m for user aircraft.
2020-12-05 21:29:01 +00:00
Scott Giese
43c530b660 Modernize: std::string_literals 2020-12-05 14:25:59 -06:00
Scott Giese
eabd4bbc7f Fix textNasalSys 2020-12-05 13:35:48 -06:00
James Turner
b41e3694b6 Sentry: install new SimGear callback
Requires matching SG change to expose the callback. Allows SimGear 
to explicitly report an error (without any dependency on Sentry of
course)
2020-12-03 21:38:57 +00:00
Automatic Release Builder
8f9f0cbb19 Change default Windows download-dir to
$HOME/FlightGear/Downloads

Add a launcher warning about this, to request users to relocate existing
files, they already downloaded.
2020-12-02 17:36:12 +00:00
James Turner
7279b51785 Traffic: harden RunwayGroup::setActive
When incorrect rwyprefs.XML input is provided, don’t crash in this
method, just skip the incomplete entries.

Ticket: https://sourceforge.net/p/flightgear/codetickets/2439/
2020-12-02 17:29:33 +00:00
James Turner
602360cdeb Add graphics-presets logic (as a subsystem)
Gives the ability to define graphics settings via an XML file at
startup or later during runtime. Tracks if changes to graphics settings
required additional actions (eg, scenery reload or restart of the sim)

When a preset is active, and properties are modified, the system will
detect this and mark the preset as edited.
2020-11-30 15:45:13 +00:00
Erik Hofman
4947b18371 Comment out the weather updating code for now 2020-11-30 10:18:48 +01:00
Nathaniel Warner
f5e277fc5a Remove unnecessary include 2020-11-29 15:04:48 -08:00
Nathaniel Warner
512f1ba3d9 Use observer_ptr in OrthophotoManager 2020-11-29 15:01:23 -08:00
Scott Giese
f03358d4f8 Merge branch 'next' of https://git.code.sf.net/p/flightgear/flightgear into next 2020-11-27 18:00:06 -06:00
Nathaniel Warner
4ddc3dc8aa Fix orthophotos not being cleaned up on scenery reload 2020-11-27 17:54:55 -06:00
James Turner
443b4fa900 Different fix for ticket 2108, avoiding another issue
Original bug: https://sourceforge.net/p/flightgear/codetickets/2108/
New bug: https://sourceforge.net/p/flightgear/codetickets/2430/
2020-11-27 18:51:27 +00:00
Stuart Buchanan
4e46548250 Set minimum expiry time on STG nodes. 2020-11-26 22:59:39 +00:00
Julian Smith
a69e56043a src/Viewer/sview.cxx: fixed incorrect heading and roll when cloning some lookfrom views.
Bug happened with views that specify non-zero heading or roll.
2020-11-25 21:31:05 +00:00
Julian Smith
a094b822f8 Revert "src/Viewer/splash.cxx: also show info about CompositeViewer if disabled."
This reverts commit 1cf5b2ab44.
2020-11-25 21:31:05 +00:00
Colin Geniet
fa09c3a6e2 Submodels: Fix wind being applied twice on init
For FGAIBallistic objects affected by wind, speed vector denotes airspeed.
However, submodels initialize the speed vector using ground speed of the
parent aircraft, instead of its airspeed.

In effect, this means that wind is added to the initial airspeed,
or 'wind is applied twice on initialization'.
This was very noticeable when releasing a submodel with strong sidewind:
the submodel immediately starts drifting laterally at the speed of wind.

Fix the issue by subtracting wind vector from initial speed in
FGSubmodelMgr::transform for submodels affected by wind.
2020-11-24 10:35:01 +00:00
James Turner
43d32e809c Metar parsing: more input validation
Trying to avoid parsing an empty string.

Sentry-Id: FLIGHTGEAR-132
2020-11-24 09:08:50 +00:00
James Turner
6e79485b65 Start adding MarkDown docs for various internals 2020-11-24 09:08:50 +00:00
James Turner
c2e4e46546 Remove docs from the dawn of time.
All of these are subsumed by CMake these days, hurrah.
2020-11-24 09:08:50 +00:00
Nathaniel Warner
88a8cada51 Rebase photoscenery patch on next 2020-11-23 17:53:35 -06:00
Erik Hofman
b73413d52e Part 2: Work towards the option of interpolating between climate tiles by combining all climate related ground level parameters in one structure and calculating the sea level tile from the (not yet interpolated) ground level tile. Read the elevelation of the climate tile from the köppen database image which now contains the climate class in the red channel and the ground elevation in the green channel. 2020-11-22 19:29:35 +01:00