1
0
Fork 0
Commit graph

696 commits

Author SHA1 Message Date
legoboyvdlp R
8268cdc5e0 Optimize slot checking routines so unneeded code is not run, document function 2020-04-30 16:22:59 +01:00
legoboyvdlp R
97ca43a52a Correct description of getDistanceToGo() - this returns meters, not feet. Looking at the code it appears that it won't break anything to use the wrong units, so we'll just fx the documentation to make it clear its meters 2020-04-30 16:22:59 +01:00
legoboyvdlp R
c789687da0 Formatting, change single-use pointers to std::unique_ptr 2020-04-30 16:22:59 +01:00
legoboyvdlp R
4af75c4666 ATC / AI subsystem: replace iostream with SG_LOG() and make new function in SchedFlight that will create a new scheduled flight instance 2020-04-30 16:22:59 +01:00
gallaert
99083d6b35 Replace boost::tuple by std::tuple 2020-04-22 14:06:13 +01:00
James Turner
381919451d Fix for reset crash:
https://sourceforge.net/p/flightgear/codetickets/2217/

This requires a matching Simgear change, but ensure all places
tolerate Nasal subsystem being gone, since this occurs during reset.
2020-04-22 10:56:54 +01:00
Stuart Buchanan
1d6b6d9753 Add carrier parking positions to property tree
This adds the names of the available parking positions/catapults
to the property tree, so we can build a suitable in-sim list
of parking positions for users to select from.
2020-04-18 18:07:25 +01:00
gallaert
fb65f64342 Replace BOOST_FOREACH by C++ 11 for range loop. 2020-04-12 14:40:36 +01:00
gallaert
36f8036ce1 Statements following return, break, continue, goto or throw will never be executed. 2020-04-11 22:07:15 +01:00
Stuart Buchanan
dc6fb53596 Correct defaults FLOLS angle from 3 to 3.5 degrees
Adjusted to match the FLOLS model and code.

On carrier approaches 0.5 degress makes a surprising
level of difference!
2020-04-04 18:03:20 +01:00
James Turner
330422faf3 C++ modernisation tweaks 2020-04-04 08:06:15 +01:00
Stuart Buchanan
e0fb27037b Carrier launcher: Usability improvements
- Support for <description> under <entry> in AI scenario
- Carrier icon consistent with UI
- Location "ship" icon toggles between ships and airports.
2020-04-03 21:43:19 +01:00
James Turner
177fc565da Launcher: initial carrier support
Allow selecting carriers from scenarios, and starting at either a
parking position, or a distance offset from the FLOLS (effectively
a crude ‘on-final’)

Extend the —carrier startup option to accept a runway ident of FLOLS,
in conjunction with the existing —offset-distance argument.
2020-03-20 15:51:47 +00:00
James Turner
2dcf9c30bb Further path -> UTF8 fixes for Windows
Requires corresponding SimGear change. With this last round, we work
with FGData on non-Latin1 path on Windows. (Final fixes are for
Nasal io.readfile, which needed io.stat to work, and SGSky allowing
correct SGPath use)
2020-03-15 15:00:55 +00:00
James Turner
27410761f3 Lots of UTF8 path correctness fixes 2020-03-12 14:23:44 +00:00
jano
395a654692 make the aiship speed respect strictly the target speed when close enough, should improve drifting carrier on mp 2020-01-28 11:03:20 +01:00
jano
db295a9afc introduction of a zero lag mode when pilots are synched in time, eg using ntp. 2020-01-14 11:10:28 +01:00
Edward d'Auvergne
34a6cb3c74 SGSubsystem classes: Registration of all subsystems. 2019-07-01 14:51:32 +02:00
Edward d'Auvergne
d259c70560 SGSubsystem classes: Addition of staticSubsystemClassId() to all subsystems. 2019-07-01 14:51:32 +02:00
Edward d'Auvergne
fb5c36fc82 SGSubsystem classes: Renaming of the subsystem ID variables and functions. 2019-07-01 14:27:30 +02:00
Edward d'Auvergne
7a6e63ddb9 SGSubsystem classes: Subsystem and subsystem group API declaration standardisation.
This is a cleanup commit.
2019-07-01 14:27:30 +02:00
Edward d'Auvergne
60a2444766 SGSubsystem classes: Whitespace standardisation of the declarations.
This is a clean up commit prior to the subsystem API standardisation to simplify
the diffs.  It includes all SGSubsystem and SGSubsystemGroup derived classes.
2019-07-01 14:27:28 +02:00
James Turner
4915b7d3a5 Merge /u/dancliff/flightgear/ branch fix_for_AI_radius into next
https://sourceforge.net/p/flightgear/flightgear/merge-requests/163/
2019-05-18 15:41:28 +00:00
Dan Wickstrom
c6e91d8751 Check for valid value when updating AI lod radius. 2019-05-18 11:30:37 -04:00
James Turner
910bd2c0fd Fix for sub-model initial offsets
The offset in body coordinates is needed by the FGAIBallistic in some
cases, restore this.
2019-05-18 16:20:31 +01:00
Dan Wickstrom
35c24ce5d4 Update radius of AI model after model data is loaded - prevents rendering artifacts at near/far camera boundary. 2019-05-18 07:10:40 -04:00
Stuart Buchanan
5f2f72a4eb Fix AI Scenarios
Due to e43fe82094 models in AI scenarios were
being searched down the AI/Aircraft and Aircraft paths, where in fact
they are by default a full path from FGDATA.

This fixes the problem by setting DATA_ONLY as the search order.
Other search orders can be set in the scenario file by setting
the search-order tag to "DATA_ONLY", "PREFER_AI", "PREFER_DATA"
2019-05-15 21:09:49 +01:00
Stuart Buchanan
1d1096d6f7 All start from parking position with no ground net
Fix for https://sourceforge.net/p/flightgear/codetickets/2125/

Previously, selecting a non-pushback parking position from the l
auncher that did not have a ground network resulted in the
aircraft being placed in the center of the airport.

This resolves the problem by creating a default segment simply
moving forward 2m.
2019-05-04 17:43:33 +01:00
James Turner
b2bedfd485 Fix typo in submodels commit 2019-04-22 11:58:55 +01:00
James Turner
ea336af4dc Submodel offset supports pitch/yaw values
Reported by Stewart Andreason
2019-04-19 10:15:36 +01:00
Stuart Buchanan
ff12994554 Execute load/unload Nasal for both detailed and AI
Previously only the first of a detailed/bare AI model tuple's Nasal
would be executed when the model is loaded.  This loads both.
2019-04-06 22:22:02 +01:00
Torsten Dreyer
d1116b0e25 fix "error: use of ‘n’ before deduction of ‘auto’" 2019-02-06 09:45:45 +01:00
James Turner
1e0e7f7ffa Rename {ai}/controls/flight/longitude-mode
Assuming this should have been ‘vertical-mode’ all along, since the
corresponding other mode property is called ‘lateral-mode’. Make an
alias to the old name to keep existing scripts working.
2019-02-03 13:38:51 +00:00
James Turner
49c4dc5213 Scenarios from FG_HOME, aircraft and add-ons
Enhancements suggested by Nikolai Verner-Christensen - support loading
scenarios from {FG_HOME}/Scenarios, {aircraft-dir}/Scenarios and
{add-on}/Scenarios. 

Additionally, allow passing the path to a scenario file to
 —ai-scenario, eg —ai-scenario=/home/jmt/FGFS/my-test-scenario.xml

When a scenario defines a carrier, and —carrier is used to request a
carrier start, we now auto-load the corresponding scenario, to give
a nicer user experience.
2019-02-03 12:12:00 +00:00
ThomasS
2d5d26260e 1) model search order property in super class AIBase and overridden by sub classes.
2) model search order stored as the enum type in AIBase.
2019-01-06 13:57:22 +00:00
James Turner
c3cd7b3978 Remove public use of sglog()::would_log() 2018-12-14 15:41:53 +00:00
Richard Harrison
015742b28d LOD: Multiplayer fix
The problem was using FLT_MAX, FLT_MAX to disable a model; this tricked OSG into thinking that FLT_MAX was a valid range and therefore didn't do the update traversal (found by Stuart).

The correct technique to disable a model is to set the min/max range to 0,0

Also generally improved the way that the ranges are managed.
2018-12-03 06:19:04 +01:00
Richard Harrison
c09f49e70c LOD: use FLT_MAX as the maximum value in setRange (rather than 100k)
- This is one/the reason for the carrier not being visible when viewing it closely (e.g on cat-1 when view zoomed in)
2018-11-26 21:54:48 +01:00
ThomasS
a8b550ee95 fgcommands "add-aiobject" and "remove-aiobject" for adding/removing objects to the AI subsystem. 2018-11-21 09:28:44 +01:00
James Turner
31f8f86e12 Fix an inverted flag in Radar calculation
https://sourceforge.net/p/flightgear/codetickets/2083/

Thanks to Jean Pellotier for spotting.
2018-11-08 09:43:29 +01:00
Richard Harrison
88720a031b Changes to the model interior LOD management.
If a model is marked as <usage>interior</usage> there were a number of problems.

1 - the LOD setting AI/MP interior used the distance from the aircraft; this obviously doesn't quite work for when using the model view.
2 - with the way that models are now loaded as two LOD levels only the interior from the first model loaded (usually the lowest detail) would be considered or processed because the model loader had marked itself as already run (which it had, but not for the model that was actually just loaded.

(2) above could also be the cause of other things not working because the nasal model loaded would not be called, nor would the sound path be setup. There could be other things that aren't working properly because the assumption is that there is just one model.

The fix for (1) is to use the standard OSG PagedLOD and let it handle the details, so I've changed the interior to use this and removed the distane from ownship checks.

The fix for (2) is to use a map to decide if the model that has just finished loading has already been processed, and if not then proceed as normal.
2018-11-06 18:42:07 +01:00
Richard Harrison
e970db3c61 LOD ranges:
Change the single model case to always set the range on the only model rather than the constant modelHighDetail. This is a regressions caused by the change from 0 to modelHighDetail and the reordering the list. When there is only one model the setRange must always refer to model range index 0.

- This could have caused models to not display correctly.
2018-11-05 19:29:20 +01:00
Richard Harrison
c99ea20883 LOD ranges rework.
Rework the LOD ranges.

1. The scenery ranges are now deltas (avoids overlapping values)
2. The AI/MP pixel mode now has a default radius that is 20 for Aircraft, 200 for ships, 350 for carriers. This is a simple constant in a virtual function.
3. Added the ability to set the AI/MP ranges equal which means use the low detail model.
4. Changed high detail only to be indicated by a -ve number in maxRangeDetail
5. Re-ordered the range list to go from lowest detail at [0] to highest detail at the end. This is because OSG always loads the models starting from zero on the assumption that the detail increases with the index.

This fixes the pixel mode, which previously would use the radius of the parent which would be confusingly large, and unrelated to the actual size of the model. With the simple defaults that we have the pixel values set in the ranges won't exactly match the rendered size of the model on screen, but it will be a lot closer and more importantly meaningful.
2018-10-30 21:05:55 +01:00
Richard Harrison
54ba92afd8 Fix null pointer dereference during startup
(may happen at other times, but definitely happened to me on startup)
2018-09-25 16:53:06 +02:00
James Turner
8b25244d90 Performance: cache TCAS nodes on AI aircraft
Removes some remaining hot property lookups each frame
2018-09-24 15:34:20 +01:00
James Turner
14a1390a68 Crash fix: warn doing fallback for heliport runways
Due to an apt.dat bug, EGEL (Coll) is actually a heliport (Eddystone
lighthouse) with zero runways. Guard against this case to avoid a
crash.
2018-09-10 10:44:49 +01:00
James Turner
ef98b667b4 AI: cache radar properties as nodes
When many AI objects, the cost of looking up the radar properties
for each object, each frame, is significant.
2018-09-09 15:24:52 +01:00
Ganael Laplanche
63d6f0218b Use nullptr instead of NULL 2018-09-02 14:17:26 +02:00
Ganael Laplanche
ff69754756 Fix build with clang 7 on FreeBSD 12-CURRENT:
src/AIModel/AIFlightPlanCreatePushBack.cxx:96:48: error: ordered comparison between pointer and zero ('FGTaxiNode *' and 'int')

(see: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=230502)
2018-09-01 22:27:07 +02:00
James Turner
a419a80de4 Clang/C++11 warning fixes 2018-08-20 02:59:23 +01:00