1
0
Fork 0
Commit graph

15593 commits

Author SHA1 Message Date
Tobias Dammers
5fabf44e51 src/Instrumentation/tcas.cxx: fixed handling of Swift craft.
Altitude of Swift craft is not in transponder information.
2021-11-09 22:00:11 +00:00
Julian Smith
ec1a53d428 src/Radio/itm.cpp: avoid warnings about fallthrough in switch blocks.
Uses C==17's [[fallthrough]] attribute.
2021-11-09 22:00:11 +00:00
Julian Smith
3b902aa0a0 src/Time/TimeManager.cxx: use C++'s chrono to avoid need for platform-dependent time/sleep code. 2021-11-09 22:00:07 +00:00
Julian Smith
0571418fe6 src/GUI/GettingStartedTip.hxx: fixed clang++ warning. 2021-11-09 21:47:00 +00:00
Julian Smith
b5e3c08255 scripts/python/performance_replay.py: force replay of view and window size.
For performance replay, we need to ensure that replaying recordings will
replay changes to the view and main window size, if they are present in the
recording. [Replay of these changes can be disabled in the "File/Flight
Recorder Control" dialogue.]
2021-11-08 23:18:31 +00:00
Julian Smith
50a4d86961 Added support for performance testing by replaying recordings.
scripts/python/performance_replay.py
    New, script for replaying a recording in Flightgear and gathering
    statistics.
scripts/python/recordreplay.py
    Minor change.
src/Aircraft/replay.cxx
src/Aircraft/replay.hxx
    If /sim/replay/log-frame-times is true, populate
    /sim/replay/log-frame-times/dt[] with frame times while replaying.
2021-11-08 22:44:25 +00:00
Julian Smith
217d612d6a src/Time/TimeManager.*: fixed bug when transitioning to simple-time.
We need to set _firstUpdate when /sim/time/simple-time/enabled changes to true,
otherwise there can be a delay before the FDM carries on.
2021-10-24 15:25:20 +01:00
Julian Smith
e62c15cdad docs-mini/README-mp-carriers.md: new, info about auto-attach and latch-always. 2021-10-24 15:24:36 +01:00
Julian Smith
129d3ab02a docs-mini/README-simple-time.md: new, info about simple-time. 2021-10-24 15:24:36 +01:00
Julian Smith
478de54fc7 docs-mini/README-recordings.md:minor fix. 2021-10-24 15:24:36 +01:00
Julian Smith
2b6ccadef6 src/Aircraft/replay.cxx: extra diagnostic if save to file fails.
Also reduced m_continuous_in_config diagnostic.
2021-10-24 15:23:58 +01:00
Stuart Buchanan
c1fc71066b WS30 Move VPB tile loading to the tile manager
Previously VPB tiles were loaded by the STG file loader.

This was not ideal as the VPB tile granularity is 1x1 degree
while the STG file loader is 20x20km.

This change makes the tile manager load VPB tiles explicitly
on range, and allows better prioritization of the underlying
terrain.
2021-10-20 23:39:59 +01:00
Tobias Dammers
c8a3f60245 Synchronize elevation-ft property in environment
This fixes some issues with Basic Weather producing invalid pressure
altitudes under some circumstances.
2021-10-20 13:34:32 +01:00
James Turner
b6e4cbbf14 Metar: add safe string storage for tied property 2021-10-20 13:25:02 +01:00
Richard Harrison
138a678a30 Carriers; support for island textures 2021-10-18 18:12:11 +02:00
Richard Harrison
533791d53a AutoTower: Remove obsolete warnings and code 2021-10-18 18:11:46 +02:00
Richard Harrison
380e647d6f Fix compile error for Highlight on windows 2021-10-18 18:11:28 +02:00
Richard Harrison
0f6341352b Added gear position in meters to yasim and jsbsim 2021-10-18 18:11:11 +02:00
Richard Harrison
be39d5b6ef Fix compile warnings 2021-10-18 18:10:40 +02:00
James Turner
d576b4c6e9 Adapt to revised SGMetar API
API is changed to use strings instead of raw pointers.
2021-10-15 15:32:11 +01:00
James Turner
c136b31791 Updated for revised SGMetar API 2021-10-15 12:14:01 +01:00
Stuart Buchanan
c92d1c01a7 WS30: Remove lod-range-factor and VPB max range
Better handled by setting the LoDScale in the camera
rather than modifying the LoD ranges themselves.
2021-10-12 21:41:11 +01:00
Julian Smith
96dee79873 src/GUI/Highlight.cxx: fixed bug in ::bind() that causes crash on startup.
We need to create sim/highlighting/enabled if it doesn't already exist.
2021-10-08 23:13:39 +01:00
b'Fernando Garc\xc3\xada Li\xc3\xb1\xc3\xa1n
5536dce0fd Merge /u/amalon/flightgear/ branch vr_3 into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/264/
2021-10-08 14:17:23 +00:00
portree_kid
8c537a911e Init of repositioned flag 2021-10-08 13:25:07 +01:00
Julian Smith
1bafe15c4c Added highlighting system.
If /sim/highlighting/enabled is true, we highlight animated objects under the
pointer, and also highlight other objects that are animated by the same or
related properties.

The intent here is to be able to give a visual indication of what cockpit
controls do or what cockpit controls affect particular aircraft objects - for
example moving the pointer over the flaps will highlight the flaps and also
highlight any controls or rotary indicators in the cockpit that are associated
with the flaps.

To make this work, we have to discover associations between properties. This
is currently done for YASim (e.g. associations between /controls/flight/flaps
and /surface-positions/flap-pos-norm) and autopilot filters (e.g. with
the 777, digital filters associate /controls/flight/rudder-nul with
/fcs/fbw/yaw/rudder-ratio-out). We don't currently gather associations between
properties in JSBSim

We also detect associations between dialogs, menus and keypresses and
properties, which is used to populate /sim/highlighting/current with
information about dialogs, menus and keypresses that are associated with the
currently highlighted nodes' properties.

Details:

src/GUI/Highlight.cxx
src/GUI/Highlight.hxx
src/GUI/CMakeLists.txt
src/Main/fg_init.cxx
    New subsystem called 'highlight', with support for registering and
    recovering links between menus, dialogs, keypresses and OSG node
    animations.

    Provides a function Highlight::highlight_nodes() which highlights
    related nodes using internal NodeHighlighting class, and populates
    /sim/highlighting/current with information about related dialogs, menus and
    keypresses.

    The NodeHighlighting class works by making nodes use an alternative
    StateSet which shows up as a distinct material on screen. We remember each
    highlighted node's original StateSet so that we can un-highlight. We update
    the material parameters using a listener for /sim/highlighting/material,
    which allows some control over the appearence of highlighted nodes.

src/FDM/flight.cxx
src/FDM/flight.hxx
    Added virtual method FGInterface::property_associations() which returns
    property associations from the FDM. Default implementation returns empty
    set. Implemented in YASim, but not (yet) in JSBSim. Uses a simple function
    pointer at the moment to avoid requring FDMs to use recent C++ features.

src/FDM/YASim/FGFDM.cpp
src/FDM/YASim/FGFDM.hpp
src/FDM/YASim/YASim.cxx
src/FDM/YASim/YASim.hxx
    Gathers information about property associations on startup such as
    /controls/flight/flaps => /surface-positions/flap-pos-norm, then
    YASim::property_associations() overrides default implementation to return
    these associations.

src/Autopilot/analogcomponent.cxx
src/Autopilot/analogcomponent.hxx
src/Autopilot/digitalfilter.cxx
src/Autopilot/inputvalue.cxx
src/Autopilot/inputvalue.hxx
    Filters now gather information about their input/output properties and
    register with Highlight::add_property_property(). For example this makes
    highlighting work on the 777, where pilot controls affect control surfaces
    only via filters.

src/GUI/new_gui.cxx
    Scan menus, keypresses and dialogs and register associations with
    Highlight::add_*().

src/GUI/property_list.cxx
src/GUI/property_list.hxx
src/GUI/FGPUIDialog.cxx
    Added <readonly> flag to property-list. If set, we don't show .. or . items
    and don't respond to mouse/keyboard.

    Used by fgdata's new Highlighting dialogue.

src/Model/acmodel.cxx
src/Model/acmodel.hxx
    Visit the user aircraft's scene graph when it is loaded, gathering
    information about osg::Node's that are animated by properties, and register
    these associations with Highlight::add_property_node().

src/Viewer/renderer.cxx
    When scanning for pick highlights, use Highlight::highlight_nodes() to
    highlight animated objects under the pointer and related objects.
2021-10-08 06:13:04 +01:00
Julian Smith
95ea8248c8 src/Autopilot/digitalfilter.hxx: removed unused members. 2021-10-06 12:18:44 +01:00
James Hogan
bad7047c36
VR: Visibility mask support
Update osgXR to 0.3.3 which provides support for visibility masks using
the depth buffer, and extend VRManager to support them.

The following properties are added:
 - /sim/vr/openxr/extensions/visibility-mask: This exposes whether
   visibility masks are supported by the current OpenXR runtime, and
   maps to osgXR::Manager::hasVisibilityMaskExtension().
 - /sim/vr/visibility-mask: This allows visibility masks to be enabled
   and disabled, and maps to osgXR::Settings::setVisibilityMask() via a
   listener.

Finally we inform osgXR that it should use SimGear's newly defined
LEFT_BIT and RIGHT_BIT NodeMask bits for the visibility masks using
osgXR::Manager::setVisibilityMaskNodeMasks(). This allows a single
stereo camera to have a visibility mask for each eye.
2021-10-05 23:44:27 +01:00
PortreeKid
cf4801e11c * Improved lead distance & handling of sharp turns
* Takeoff leg respects displaced threshold
2021-09-30 11:20:11 +01:00
PortreeKid
d783008c08 * Improved YSSY.groundnet.xml 2021-09-30 11:19:41 +01:00
James Turner
8574b4f1bc Launcher: improve local acft rescan behaviour 2021-09-30 11:19:41 +01:00
Julian Smith
4d238b18e3 docs-mini/README-recordings.md: added info on record/replay properties. 2021-09-30 08:02:13 +01:00
Julian Smith
3e7e970e5d src/Instrumentation/tcas.*: condensed checking of transponder.
Transponder-checking code is now done in new static function
checkTransponderLocal() which also sets altitude via an out-param. This
avoids duplicate string comparisons in the previous checkTransponder() and
getAltitude() functions.

Also check for controls/invisible for all aircraft, which could allow ignoring
of AI and Swift aircraft in future.

TCAS::ThreatDetector::checkTransponder() now simply calls
checkTransponderLocal() with a dummy altitude out-param; it doesn't appear to
be used so could probably be removed.
2021-09-25 10:56:06 +01:00
Michael Danilov
9b05b2f941 src/Instrumentation/tcas.*: improved treatment of AI, MP and Swift aircraft.
Change the assumption that velocity < 40kt implies the transponder is off, to
only apply to AI aircraft, because exact information is available for other
(i.e. multiplayer and swift) aircraft.

Add new check for multiplayer/swift aircraft where if the altitude is -9999, we
treat the transponder as off.

With swift and multiplayer aircraft, use the transponder altitude information,
not the sim's internal altitude data for the aircraft.
2021-09-25 10:56:06 +01:00
James Hogan
7db47beb0e
VR: Implement mirroring of VR to desktop
Set up the default camera as a mirror of the VR view when needed, using
a new CameraInfo flag named VR_MIRROR based on a camera property
"vr-mirror" which is set on the default camera group. When set this flag
causes the compositor to be constructed (and reloaded) using
buildVRMirrorCompositor() and osgXR's mirror camera setup code, rather
than the usual Compositor::create().
2021-09-12 00:02:44 +01:00
James Hogan
7bea10a8e4
VRManager: Add mirror properties
Implement VR mirror properties and associated getUseMirror() accessor:
 - /sim/vr/mirror-mode: This will allow the user to control the VR
   mirror via a GUI.
 - /sim/vr/mirror-enabled: This isn't written, but is used by
   getUseMirror() in combination with isRunning() to determine whether
   the mirror should be used.
2021-09-11 23:49:25 +01:00
James Hogan
04c6821b8c
CameraGroup: Reset compositor order offset on reload
Use the newly added simgear::Compositor::resetOrderOffset() to reset the
order offset counter with each compositor reload. This prevents the
counter increasing indefinitely, which soon results in render orders
beyond those set statically for the GUI and upcoming VR mirror.
2021-09-11 18:05:27 +01:00
James Turner
07dfb6496c Allow aircraft directory name validation.
Patch by Michael Danilov: allow an aircraft set XML to define the requied
directory name, and if one is provided,  validate the actual name against
this. This catches common issues where a manually downloaded aircraft
has the wrong name and some assets will therefore not load.

SF-Ticket-ID: https://sourceforge.net/p/flightgear/codetickets/2647/
2021-09-06 16:05:09 +01:00
Lars Toenning
f00d843c8f swift: COM volume support 2021-09-06 14:12:42 +01:00
b'Fernando Garc\xc3\xada Li\xc3\xb1\xc3\xa1n
c50fe8de07 Merge /u/amalon/flightgear/ branch vr_1 into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/253/
2021-09-03 22:19:11 +00:00
James Hogan
db4525abf9
VR: Implement minimal VR support
Implement support for virtual reality headsets via version 0.3 of the
osgXR[1] library I've been working on which uses OpenXR.

Add a new VRManager class based on osgXR::Manager to implement its
callbacks. When osgXR needs a new view created, we build a new camera in
the default camera group, and notify osgXR of each new "scene" typed
render pass. It also hooks into the CameraInfo's new compositor reload
callback to ensure osgXR is updated when the compositors are reloaded.

VR settings are controlled by properties, and new --enable-vr /
--disable-vr options are implemented to enable/disable VR at start.

This is enough to get basic VR for looking around the cockpit, but more
work will be required to support a desktop mirror of VR view, VR splash
screen, VR GUI, controller interaction, and correct positional sound.

[1] https://github.com/amalon/osgXR
2021-09-03 12:09:20 +01:00
James Hogan
dcdda1044a
VR: Find the osgXR library
Allow the osgXR[1] library to be found and linked against. We'll use
this to implement VR in FlightGear.

[1] https://github.com/amalon/osgXR
2021-09-02 22:29:09 +01:00
James Turner
4236cee7b2 Another waypoint selection test from MikeD
Currently selects the wrong VOR, bvut the code is working as
designed, we think.
2021-09-02 11:29:02 +01:00
James Turner
90f14626f5 Guard against a possible crash in TowerController 2021-09-02 11:29:02 +01:00
James Turner
2cca2c0b4e Fix an ASan error
This code can overlap its source and destination ranges, so replace
memcpy with memmove.
2021-09-02 11:29:02 +01:00
Fernando García Liñán
08aed1ccc8 Canvas: Do not hold a reference to the GUI camera
It might be not be valid anymore after a reset. Just query it when needed.
2021-08-31 18:15:28 +02:00
PortreeKid
f1a44c98df AI Improvements
* Relax runway exit route requirement to 80°
* Ensure parking is only reset if airport for AI aircraft has changed
* Heading Error signed and arrival lead distance
2021-08-31 09:43:24 +01:00
James Turner
06c03a0672 Tolerate Aircraft/ prefix in preview paths
Reuqested by Jonathan R, allow Aircraft/<acft-dir>/foo paths to work
for preview iamges.

SF-ID: https://sourceforge.net/p/flightgear/codetickets/2644/
2021-08-31 08:57:18 +01:00
Julian Smith
74dd221e60 src/Viewer/splash.cxx: removed CompositeViewer startup message. 2021-08-29 23:13:32 +01:00
Fernando García Liñán
83b0a31b76 Canvas cameras are slave cameras instead of scene graph cameras
This was a long-standing issue where Canvas cameras were rendered
multiple times, once per slave camera. In the case of the Classic
pipeline they were being rendered twice.

Making them slave cameras has the issue of them not being shared
across GraphicsContexts anymore, so it's not possible to see Canvas
displays in extra CameraGroup windows. This is fixed by using OSG
context sharing feature and sharing the initial windows' context
with all subsequent windows.
2021-08-27 18:34:19 +02:00