We now attach global event handler to extra view windows so key presses are
handled as normal.
And the main event handler for mouse movements now calls new SviewMouseMotion()
which pans/tilts extra view windows in response to right-button mouse-drag.
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
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.
- 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/
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/
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.
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.
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.
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.
Overview:
Previously Flightgear always used a single osgViewer::Viewer(), which
inherits from both osgViewer::ViewerBase and osgViewer::View, giving a
single view window.
If CompositeViewer is enabled, we instead use a osgViewer::CompositeViewer
which contains a list of osgViewer::View's. Each of these View's can have
its own eye position, so we can have multiple different views of the same
scene.
Enable at runtime with: --composite-viewer=1
Changes to allow use of osgViewer::CompositeViewer:
Previously FGRenderer had this method:
osgViewer::Viewer* getViewer();
This has been replaced by these two new methods:
osgViewer::ViewerBase* getViewerBase();
osgViewer::View* getView();
If CompositeViewer is not enabled (the default), the actual runtime state
is unchanged, and getViewerBase() and getView() both return a pointer to
the singleton osgViewer::Viewer() object.
If CompositeViewer is enabled, getViewerBase() returns a pointer to a
singleton osgViewer::CompositeViewer object, and getView() returns a
pointer to the first osgViewer::View in the osgViewer::CompositeViewer's
list.
The other significant change to FGRenderer() is the new method:
osg::FrameStamp* getFrameStamp()
If CompositeViewer is not enabled, this simply returns
getView()->getFrameStamp(). If CompositeViewer is enabled it returns
getViewerBase()->getFrameStamp(). It is important that code that previously
called getView()->getFrameStamp() is changed to use the new method, because
when CompositeViewer is enabled individual osgViewer::View's appear to
return an osg::FrameStamp with zero frame number).
All code that uses FGRenderer has been patched up to use the new methods so
that things work as before regardless of whether CompositeViewer is enabled
or not.
We make FGRenderer::update() call SviewUpdate() which updates any extra
views.
Extra view windows:
If CompositeViewer is enabled, one can create top-level extra view windows
by calling SviewCreate(). See src/Viewer/sview.hxx for details.
Each extra view window has its own simgear::compositor::Compositor
instance.
Currently SviewCreate() can create extra view windows that clone the
current view, or view from one point to another (e.g. from one multiplayer
aircraft to the user's aircradt) or keep two aircraft in view, one at a
fixed distance in the foreground.
SviewCreate() can be called from nasal via new nasal commands "view-clone",
"view-last-pair", "view-last-pair-double" and "view-push". Associated
changes to fgdata gives access to these via the View menu. The "view-push"
command tags the current view for later use by "view-last-pair" and
"view-last-pair-double".
Extra view windows created by SviewCreate() use a new view system called
Sview, which allows views to be constructed at runtime instead of being
hard-coded in *-set.xml files. This is work in progress and views aren't
all fully implemented. For example Pilot view gets things slightly wrong
with large roll values, Tower View AGL is not implemented, and we don't
implement damping. See top of src/Viewer/sview.cxx for an overview.
OpenSceneGraph-3.4 issues:
OSG-3.4's event handling seems to be incorrect with CompositeViewer -
events get sent for the wrong window which causes issues with resize and
closing. It doesn't seem to be possible to work around this, so closing
extra view windows can end up closing the main window for example.
OSG-3.6 seems to fix the problems.
We warn if CompositeViewer is enabled and OpenSceneGraph is 3.4.
Avoid passing missing add-ons to FlightGear. Since we only write a
cleaned list back to QSettings upon some user change, we can persist
bad paths.
Sentry-Id: FLIGHTGEAR-NG
This very first query was left un-finalized, which apparently blocks
another process from obtaining the exclusive lock needed to
COMMIT. Found using the trace funtions, phew.
Sentry-Id: FLIGHTGEAR-8C
Sentry-Id: FLIGHTGEAR-8F
- Removed the ENABLE_COMPOSITOR CMake flag.
- Removed /sim/version/compositor-support.
- Removed miscellaneous branching to check if the Compositor is enabled.
- Removed custom resource loader since Compositor Effects are now located in $FG_ROOT/Effects.
- Removed splash screen warning.
- Only use the Compositor versions of CameraGroup and FGRenderer.
- Fix redout/blackout not appearing under certain circumstances.
Previously the center of the airport was defined with the correct
elevation, but the runways etc. were built at 0 elevation.
This makes everything at 0 elevation so we can set the elevation
in the STG file for the moment.
Don’t probe for, or pass, missing paths to FlightGear. Since we don’t
show such paths in the UI, they hang around forever, causing exceptions
Sentry-Id: FLIGHTGEAR-NG
If impatient users start multiple copies of FlightGear when a cache
rebuild is required, we can get into a mess. Use an additional
named mutex on Windows to avoid this situation, and block the secondary
copies until the primary instance has completed its cache rebuild.
Sentry-Id: FLIGHTGEAR-8D
Sentry-Id: FLIGHTGEAR-FY