1
0
Fork 0
Commit graph

406 commits

Author SHA1 Message Date
Tim Moore
e342d879e8 Radar patch from Vivian 2009-07-12 01:02:58 +02:00
fredb
219be77f1e Suppress warnings 2009-07-02 08:59:16 +02:00
frohlich
33a2e2128f Simplify AI model loading.
Modified Files:
 	AIBallistic.cxx AIBallistic.hxx AIBase.cxx AICarrier.hxx
 	Makefile.am
Removed Files:
	AIModelData.cxx AIModelData.hxx
2009-06-23 10:54:10 +02:00
frohlich
8f501de78c Remove carrier wire and catapult configuration from the scenario file.
This is now included in the model xml file.
So, wires and catapults also work even if they are not loaded by an AICarrier.

Modified Files:
 	AICarrier.cxx AICarrier.hxx
2009-06-23 10:54:10 +02:00
timoore
d30398f2b2 uninitialized variable fix from Vivian Meazza 2009-06-16 11:32:14 +02:00
fredb
97c214e4fc Suppress warnings 2009-06-15 10:29:45 +02:00
jmt
6e42458a55 Convert waypoint::CourseAndDistance users to use SGGeodesy helper functions. 2009-06-11 16:05:20 +02:00
jmt
e1583cb28c Update FGViewer position clients to work with SGGeod directly 2009-06-11 16:05:20 +02:00
fredb
5b93117e2d Functions should always return a value 2009-06-03 00:18:54 +02:00
frohlich
d9c3c6da96 Fix Carriers without catapults and wires.
Modified Files:
	src/AIModel/AICarrier.cxx
2009-05-20 00:00:05 +02:00
fredb
19eab15f8e Remove few warnings 2009-05-18 12:24:17 +02:00
fredb
25c633af3e Functions should always return a value 2009-05-18 12:24:17 +02:00
durk
a4debec122 Removed hardcoded performance data. 2009-05-18 12:24:15 +02:00
Tim Moore
f528fc7154 AICarrier fixes from Vivian 2009-05-04 16:16:00 +02:00
torsten
2fc7f94154 restoring original copyright of David Culp 2009-05-02 00:44:20 +02:00
torsten
7e3531ef5c Implementation of ridge lift from Patrice Poly based on an algorithm of Ian Forster-Lewis 2009-05-02 00:44:20 +02:00
frohlich
58a427fb12 Fix a problem with node traversal masks and paged model loading that
shows up as a non solid carrier under some circumstance.

Modified Files:
	AIBase.cxx AIBase.hxx AIShip.cxx
2009-04-15 23:19:30 +02:00
mfranz
de35bbe4ed assign a unique module name to ai/mp embedded nasal (again): __model%u 2009-04-01 09:23:54 +02:00
durk
c478cdd35f Allow the AI Traffic controller to set a transponder code. This code is
used in ATC chatter, and writted to the property, so it can -in principle-
be picked up by the radar.
2009-04-01 09:23:54 +02:00
frohlich
a99ea1c7b5 Port over remaining Point3D usage to the more type and unit safe SG* classes.
Remove leftover headers from plib/sg.

Modified Files:
 	src/AIModel/AIBase.cxx
 	src/AIModel/AIFlightPlanCreateCruise.cxx
 	src/ATCDCL/AIEntity.cxx src/ATCDCL/AIEntity.hxx
 	src/ATCDCL/AIGAVFRTraffic.cxx src/ATCDCL/AIGAVFRTraffic.hxx
 	src/ATCDCL/AILocalTraffic.cxx src/ATCDCL/AILocalTraffic.hxx
 	src/ATCDCL/AIMgr.cxx src/ATCDCL/ATC.hxx
 	src/ATCDCL/ATCDialog.cxx src/ATCDCL/ATCProjection.cxx
 	src/ATCDCL/ATCProjection.hxx src/ATCDCL/ATCutils.cxx
 	src/ATCDCL/ATCutils.hxx src/ATCDCL/approach.cxx
 	src/ATCDCL/commlist.cxx src/ATCDCL/ground.cxx
	src/ATCDCL/ground.hxx src/ATCDCL/tower.cxx
 	src/ATCDCL/tower.hxx src/Airports/calc_loc.cxx
 	src/Airports/dynamics.cxx src/Airports/groundnetwork.cxx
 	src/Airports/parking.cxx src/Airports/runwayprefs.cxx
 	src/Airports/simple.cxx src/Cockpit/cockpit.cxx
 	src/Cockpit/hud.hxx src/Cockpit/hud_card.cxx
 	src/Cockpit/hud_rwy.cxx src/Environment/environment.cxx
 	src/FDM/UFO.cxx src/FDM/SP/MagicCarpet.cxx src/GUI/dialog.hxx
 	src/Instrumentation/HUD/HUD.hxx
 	src/Instrumentation/HUD/HUD_runway.cxx
 	src/Instrumentation/KLN89/kln89.cxx src/Main/fg_init.cxx
 	src/Main/viewer.cxx src/Main/viewmgr.cxx
 	src/Model/panelnode.cxx src/MultiPlayer/mpmessages.hxx
 	src/Scenery/tilemgr.cxx src/Traffic/SchedFlight.cxx
 	src/Traffic/TrafficMgr.cxx
2009-03-18 08:00:08 +01:00
frohlich
da8b3f9ce5 The simtime alread contains the increment. So do not add that twice.
Modified Files:
	src/AIModel/AIShip.cxx
2009-03-18 08:00:08 +01:00
frohlich
2d1d8120f6 Set the reference time the transform is meant for.
Modified Files:
	src/AIModel/AICarrier.cxx src/AIModel/AIShip.cxx
2009-03-18 08:00:08 +01:00
frohlich
7e73a87882 Improove FGTileMgr::scenery_available for small ranges.
Use SGGeod in FGTileMgr, FGScenery apis.

Modified Files:
	src/AIModel/AIBallistic.cxx src/Main/main.cxx
	src/Scenery/scenery.cxx src/Scenery/scenery.hxx
	src/Scenery/tilemgr.cxx src/Scenery/tilemgr.hxx
	src/Scripting/NasalSys.cxx
2009-03-18 08:00:07 +01:00
durk
9cc92035b1 A set of additions related to allow the use of SID and STAR procedures.
The current code still has some rough edges, in particular memory still
needs to be deallocated where possible, and the actual use of the code
needs more testing. This code has been running without noticable problems,
so I think it's ready for some wider exposure. Detailed changes include:
- Finetuning of the SID/STAR data concept.
- Preloading of all SIDs, from one xml file.
- ATC determines which SID should be used and echoes this over the com1 or
  com2 radio.
2009-03-11 23:14:34 +01:00
frohlich
82b54e7a25 Avoid SGLocation usage.
Modified Files:
	configure.ac src/AIModel/AIBase.cxx
	src/ATCDCL/AILocalTraffic.cxx src/FDM/Makefile.am
	src/FDM/flight.hxx src/FDM/LaRCsim/LaRCsim.cxx
	src/Main/Makefile.am src/Main/fg_init.cxx src/Main/main.cxx
	src/Main/viewer.cxx src/Main/viewer.hxx
	src/Scenery/tilemgr.cxx src/Scenery/tilemgr.hxx
2009-03-11 23:14:34 +01:00
frohlich
6b72986b27 Use api's with objects instead of scalars.
Modified Files:
	src/AIModel/AIAircraft.cxx
2009-03-11 23:14:33 +01:00
frohlich
3afc7e0690 Move the velocity computations for aimodels into AIShip.
You should now be able to step on any ship with your model.

Modified Files:
	src/AIModel/AICarrier.cxx src/AIModel/AIShip.cxx
	src/AIModel/AIShip.hxx
2009-03-05 10:52:03 +01:00
frohlich
1708e43a39 Make initial use of the boundingvolumes for the ground cache.
Modified Files:
	src/AIModel/AICarrier.cxx src/AIModel/AICarrier.hxx
	src/FDM/flight.hxx src/FDM/groundcache.cxx
	src/FDM/groundcache.hxx
2009-03-05 10:52:03 +01:00
durk
321706a007 Remove stray debug statement. 2009-03-05 10:52:03 +01:00
durk
c7e9c7a610 Some initial code for AI Aircraft making use of SIDs. Current code is a bit
experimental: Only one SID per runway is supported, and the waypoints are
read from file at every request, which is not very efficient. The current
code is only executed when FlightGear is configured to use airport dynamics
data from the scenery repository, instead of the base package. Since the
latter is still the default, I believe that this will provide enough safe-
guarding to commit SID/STAR support in small, incremental steps.
Next step will be buffering and support for multiple departure routes per
runway.
2009-03-05 10:52:03 +01:00
durk
d24fe19914 One step further toward better integration of AI and ATC systems.
* Changed the runway XX. ATC message to actually report the real
   designated departure runway
 * In case of multiple active runways, select the one with a heading that is
   closest to the direction of the ultimate departure destination / lines up
   with the arrival path.
2009-02-16 00:56:44 +01:00
mfranz
4b5353d396 make default model configurable (default: Models/Geometry/glider.ac)
This allows to set Models/Geometry/null.ac or something that doesn't
look bad in multiplayer for both fast and slow speeds, for example
the harrier.
2009-02-04 23:51:22 +01:00
fredb
41a8ae42f5 Allow the search of header files in the current directory 2009-02-02 00:58:00 +01:00
durk
9a19c238a9 And some more cleanup. 2009-02-02 00:58:00 +01:00
durk
c6f88e5b9b Development for two new features:
* Some support for geometry information provided by the custom scenery
   project. Current support is for AI groundnets and runway use files only
   since this is a switch that involves a lot of data verification and
   updating, during the transistion the actual path where the data can be
   read from is user configurable. setting the property

   /sim/traffic-manager/use-custom-scenery-data to true

  will cause flightgear to read the ground networks from the scenery
  directory (--{fg-scenery}/Airports/[I]/[C]/[A]/[ICAO].groundnet.xml to be
  precise). Setting this property to false will retain the original
  behvior.
* For departing aircraft, runway takeoff calculations will be done on the
  basis of the performance database. For testing purposes, a performance
 estimate for a heavy jet has been added.
2009-02-01 23:44:10 +01:00
Tim Moore
9bb896dd20 Merge branch 'maint' into next 2009-01-18 23:22:06 +01:00
timoore
51b686a796 Division by zero fixes from Vivian Meazza. 2009-01-18 23:17:23 +01:00
Tim Moore
76958a0382 Merge branch 'maint' into next 2009-01-14 22:32:52 +01:00
jmt
473bf5f731 Apply Ron Jensen's fix for Csaba's atan2() fix. Also remove some dead code,
and use SG_NORMALIZE_RANGE.
2009-01-14 22:31:55 +01:00
jmt
6f2dc41135 Simpler bearing and distance computations for AIFlightPlan. 2009-01-07 10:39:09 +01:00
jmt
e39373cb6a Clean up naming of the 'point on runway' helpers, to get rid of the confusing
notion of a 'displacedThreshold'. Now there's just a real threshold,
displaced or otherwise, and people who care about the paved area can use
'begin' and 'end'. Thanks to John Denker for pointing out the confusion this
leads to. Using 'end' also gets rid of the 'reverseThreshold' name, which was
clearly a bad choice of mine.
2009-01-07 10:22:53 +01:00
Tim Moore
89010e6b0a Merge branch 'maint2' into next 2009-01-04 00:25:04 +01:00
jmt
1a05695ff5 NaN fix by Csaba/Jester - prefer atan2(x,y) to atan(a/y). 2009-01-04 00:24:33 +01:00
durk
632d89d6e7 James Turner: Cleanup of AI traffic route generation code. 2009-01-04 00:17:45 +01:00
Tim Moore
43b300fe46 Merge branch 'maint2' into next 2009-01-04 00:01:46 +01:00
fredb
6ccc0b64ef Win32 fixes 2009-01-04 00:00:20 +01:00
jmt
0f4f044a94 Kill off many Point3D includes, and a couple of uses in the HUD code.
Requires a SimGear update to get some new SGGeodesy helpers.
2008-12-26 12:28:05 +00:00
durk
1fdac74f8e Minimize impact of distant AI models on the scene graph. 2008-12-10 16:04:10 +00:00
durk
931c661b40 Changes to the AIModel code, to prepare for the new traffic manager code:
- Leg loading can fail when no additional flights are available
- Better support for waypoint interception during pushback (speed ~ 0)
2008-11-16 13:41:24 +00:00
fredb
dc2341b643 Revert to previous revision after an error during last commit 2008-10-19 16:22:17 +00:00
fredb
2710564c7d Alex Perry :
This patch changes terrasync so it links against the subversion
library if you have it installed.  It supports people who build binary
releases for use by non-developers by removing the runtime external
dependency on having command line svn or rsync available.  Since the
patch changes autoconf to detect libsvn,  I'd appreciate it if people
who release binaries could verify that the detection scripting works
for their platform.

Developer warning:  If you do have libsvn developer libraries
installed, terrasync changes its default option from "-R" to "-S" to
remove the command line dependency.  However, Martin has not yet
uploaded world scenery into the subversion repository so it won't be
useful to fly against and you may want to specify "-R" on the command
line in the short term.  Or run both.


Me: Update MSVC 7.1 project file. Need svn-win32-1.x.y_dev.zip and svn-win32-1.x.y.zip
located at http://subversion.tigris.org/servlets/ProjectDocumentList?folderID=8100
2008-10-19 16:08:29 +00:00
ehofman
aa78341698 James Turner:
Convert FGRunway to be heap-based, and inherit FGPositioned. This is a large, ugly change, since FGRunway was essentially a plain struct, with no accessors or abstraction. This change adds various helpers and accessors to FGRunway, but doesn't change many places to use them - that will be a follow up series of patches. It's still a large patch, but outside of FGAirport and FGRunway, mostly mechanical search-and-replace.

An interesting part of this change is that reciprocal runways now exist as independent objects, rather than being created on the fly by the search methods. This simplifies some pieces of code that search for and iterate runways. For users who only want one 'end' of a runway, the new 'isReciprocal' predicate allows them to ignore the 'other' end. Current the only user of this is the 'ground-radar' ATC feature. If we had data on which runways are truly 'single-ended', it would now be trivial to use this in the airport loader to *not* create the reciprocal.
2008-09-11 08:38:09 +00:00
curt
c7f6156324 "make dist" fixes. 2008-08-28 21:20:21 +00:00
durk
554dba0f3f James Turner: Here's a trivial patch, when you have a moment:
- removes various members from FGRunway which no-one was using
- any of these can be trivially re-instated if and when someone
actually wants to use them - but right now they're simply bloating up
FGRunway, which we have lots of, because it currently includes all the
taxiways in Robin's data.
- that's it.
2008-08-21 16:34:33 +00:00
durk
301054204e James Turner: Improved runway management code:
- Runways are now part of an airport, instead of a separate list
 - Runways are no longer represented as a boring struct, but as a class
   of their own.
 -Improved runway access to unify various runway access methods.
2008-08-14 18:13:39 +00:00
timoore
0d0bd58268 Allow generic file protocol to terminate fg after a number of repetitions. 2008-08-07 22:24:47 +00:00
ehofman
14885374de header cleanups 2008-07-31 12:04:32 +00:00
ehofman
667e64e1eb - remove the SG_GLxxxx_H #defines, since OSG provides its own versions
- this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
   extensions.hxx was pulling in all of Carbon to the global namespace
   - very scary. As a result, I now need to explicitly include CoreFoundation
   in fg_init.cxx.
 - change SG_USING_STD(x) to using std::x
2008-07-27 16:25:13 +00:00
ehofman
d9bfd5a425 This should apply, and everything should build cleanly, in isolation from the
SimGear change. It changes all the SG_xxxx to be the 'real' includes, and gets
rid of many #ifdef SG_HAVE_STD_INCLUDES. As an added bonus, rather than
replacing 'SG_USING_NAMESPACE(std)' with 'using namespace std', I just fixed
the small number of places to use std:: explicitly. So we're no longer polluting
the global namespace with the entire contents of std, in many cases.

There is one more 'mechanical' change to come - getting rid of SG_USING_STD(X),
but I want to keep that separate from everything else. (There's another
mechnical change, replacing <math.h> with <cmath> and so on *everywhere*, but
one step at a time)
2008-07-25 18:38:29 +00:00
ehofman
eccddb3dfd Attached patches remove BORLANDC, and hence SG_MATH_EXCEPTION_CLASH and SG_INCOM
PLETE_FUNCTIONAL from SimGear and FlightGear.

As a result, SG_HAVE_STD_INCLUDES is now *always* set, so I will get the boring
fixes for that done, but separately. I'm still auditing the other things in comp
ilers.h - there's a lot that can die now BORLAND is gone.
2008-07-25 10:39:53 +00:00
durk
17c42deae1 Initial attempt to establish a better integration between AI and ATC code.
Various other patches that have been lingering around for a while:
 * Moved trafficcontrol.[ch]xx from the Airports directory to ATC, where
   it really belongs.
 * AI aircraft will request startup clearance, and ground control will
   approve.
 * Starting AI Aircraft will be pushed back to a predefined holding point
   on the ground network, and wait a while before taxiing out to the runway
2008-07-13 12:51:06 +00:00
fredb
68124ca36d Remove unused variables 2008-06-01 14:59:20 +00:00
mfranz
6fb7b8ead9 noise-- 2008-05-18 21:05:11 +00:00
durk
7783e64953 Some tweaks and finetuning made possible by the multihreaded modelloader
and the pushback code:
 - Traffic manager starts modelload requests immediately upon program
   loading
 - Only create legs 1 (push back) or five (cruise) of AI traffic.
 - AIAircraft's rather obsessive behavior to circle around a waypoint is
   largely resolved
 - More realistic ground steering for AI aircraft.
2008-04-02 19:01:48 +00:00
fredb
34e435429c Win32 fix 2008-03-22 12:18:53 +00:00
timoore
fd492a297a model paging patch from Till Busch
From Till:
i started the project at the end of february with a simple idea: move all
3d-model loading to the DatabasePager-thread. my first attempts looked
promising, though they were a little too optimistic (or naive?). the patch
has evolved a lot since.

currently it does the following things:
1. revive SGModelLib, move functions for xml-model-loading there

2. replace all calls to sgLoad3dModel with calls to either
SGModelLib::loadModel() or SGModelLib::loadPagedModel()
almost all models will be loaded by the DatabasePager. the few exceptions are:
your own plane, shared models in scenery, random objects, AIBallistic models.

3. simplify mode-loading functions (avoid passing around fg_root)

4. avoid supurious MatrixTransform nodes in loaded models

5. fix some memory leaks
2008-03-22 09:31:06 +00:00
mfranz
e5b5f7c2b1 upgrade important log messages 2008-02-23 23:58:19 +00:00
timoore
79e251383b Wingman code from Vivian Meazza 2008-02-15 11:06:27 +00:00
curt
4fa75196ce Clear chat messages when an aircraft becomes inactive in the property tree. 2008-01-29 15:02:47 +00:00
timoore
b2b35568d7 Ballistics underslung load changes from Vivian Meazza 2008-01-04 22:31:18 +00:00
timoore
7aee6b0a60 Ballistics fix from Vivian Meazza 2007-12-28 22:05:14 +00:00
timoore
9ecc3415fb Experimental patch for applying force to ballistic objects
From Vivian Meazza
2007-12-21 23:37:05 +00:00
mfranz
602e41bab6 don't write past array bounds 2007-10-11 07:41:44 +00:00
fredb
9d67f94005 Win32 fix and add a reminder in an unfinished function 2007-08-12 13:38:36 +00:00
durk
1c8f2e3c5b - Ground network XML parsing code reads the new attributes "holdPointType"
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
  current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
  implementation is slightly more computationally intensive than strictly
  required, due to the currently inability of taxidraw to link one specific
  pushBack point to to a particular startup location. FlightGear now determines
  this dynamically, and once we have that functionality in TaxiDraw, the
  initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
  aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
  constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
  limited to include pushback points and routes only, but can probably be
  extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
  order to discourage the use of certain routes over others.
2007-08-08 06:09:58 +00:00
mfranz
fad737b41e prevent multiple loading of one and the same scenario 2007-08-03 18:02:33 +00:00
mfranz
7d94177636 Vivian MEAZZA: fix subsubmodels 2007-08-01 10:44:17 +00:00
frohlich
49779e64f0 Modified Files:
src/AIModel/AIFlightPlanCreateCruise.cxx
	src/Traffic/Schedule.cxx:
	SGGeoc::fromCart should now work correct.
2007-07-27 19:31:44 +00:00
durk
c51c0b1664 Slightly altered calling sequence ensures AI aircraft are removed from
memory when flying out of user range.
2007-07-21 12:29:09 +00:00
mfranz
5c912ffad9 remove redundant if check in cases of if (foo) delete foo;
The C++ standard explicitly allows deleting a null pointer.
2007-07-20 14:46:45 +00:00
durk
b452234cb2 Fixes and code clean-up:
- Airports Directory
Thomas Foerster: Pulls out the FGTaxiNode implementation into gnnode.cxx.
Melchior / Durk: Copy Constructor and assignment operator for FGTaxiRoute

- AIModels Directory
Durk / Melchior / Czaba Halasz: Ensure that all derived classes use AIBase
member 'callsign'. Adapted, moved and deleted getter/setter functions where
necessary
Czaba Halasz: Fix AIBase model path vs. submodel path consistency.

- Traffic Directory and AIModels CreateFlightPlanCruise
DT: Temporary revert parts of the position estimation code.
2007-07-15 14:08:31 +00:00
mfranz
aacabde342 remove material name from the class 2007-07-14 07:35:12 +00:00
frohlich
e19b2289c9 Also untie waypoint-missed-count. 2007-07-14 04:27:47 +00:00
mfranz
94326d14af don't use _tgt_rudder uninitialized 2007-07-11 10:56:33 +00:00
durk
fdc1a2ba54 Bugfixes: 1) Fix the if (next) setLeadDistance bug
(reported by Csaba Halaszi /helijah)
          2) Decrease AI aircraft Heading error tolerance to 1% of its
             original value. This is necessary to mitigate spinning and
             makes for actual "on-runway" landings.
2007-07-10 07:01:54 +00:00
durk
83c37cc860 Publish and update callsigns of Traffic Manager (TM) created AITraffic. 2007-07-09 05:07:56 +00:00
frohlich
c1e29d0998 Modified Files:
src/AIModel/AIFlightPlan.hxx
	src/AIModel/AIFlightPlanCreateCruise.cxx
	src/AIModel/AITanker.cxx src/Traffic/Schedule.cxx:
	Move member variables that should better be in function local
	scope into the functions. Make more use of SGMath functions.
2007-07-08 08:46:29 +00:00
durk
f83fbfdf9c Fix "Tankers fly at warp 2" bug. 2007-07-08 07:08:49 +00:00
durk
f4529e5cfe AI traffic now honors separate runway assignments for different types of
traffic (i.e. commercial airliners will use a differnt part of the airport
than general avation, ultralight and/or military traffic.
2007-06-28 18:30:35 +00:00
durk
1613d7e63e Thomas Foerster: Prepare for the inclusion of aircraft specific performance
data for AI traffic. Default performance classes are still available as a
backup. This database will allow the calculation of aircraft-specific
take-off speed and estimate runway lenght requirements. Further added
rudimentary support for take-off and landing rotation of AIAircraft.
2007-06-28 07:47:20 +00:00
mfranz
800dd73551 Vivian MEAZZA & Tim MOORE:
- re-enable od_gauge ("owner drawn" render-to-texture instruments)
- implement radar in c++ (unlimited number of clouds/ai/mp/... objects,
  better performance)
2007-06-24 07:57:45 +00:00
fredb
97ed8554c6 Win32 fix 2007-06-16 16:16:15 +00:00
fredb
291462c25e Consistency fix 2007-06-16 15:57:42 +00:00
durk
6fc1a51e1d Removed a stray debug message. 2007-06-16 05:38:05 +00:00
durk
0643b21baa Fix for refueling and radar calculations. 2007-06-15 20:52:32 +00:00
mfranz
b4cdfed406 Vivian MEAZZA:
simulate rotational moment of inertia by using a filter
2007-06-11 20:47:20 +00:00
mfranz
d39432ea6c Vivian MEAZZA:
- let sumodels without subsubmodels die on impact
- remove "sub-id" tying

mf: move variable declarations to better places, variable renaming
2007-06-10 18:24:48 +00:00
durk
514acc9f5f Changed formatting to K&R/4 by "popular demand". 2007-06-10 06:06:57 +00:00
durk
ba8ed137cf Code cleanup of AIModels (mainly AIAircraft), by Thomas Foerster 2007-06-09 11:49:16 +00:00
mfranz
2e1756156f another secret commit to sneak in stuff:
- cleanup
2007-06-07 22:48:37 +00:00
mfranz
5a73a46cd0 Vivian MEAZZA:
- collision detection for AI objects
- subsubmodels

mf: various modifications; more general cleanup to do
2007-06-07 16:30:26 +00:00
mfranz
d11e18f9a7 Syd ADAMS:
"normalize the radar x and y-shift , 0 to 1.0 based on
/instruments/radar/range to make animation simpler"
2007-06-03 18:17:05 +00:00
mfranz
bbb1d2d0c3 - add heading-deg, pitch-deg, roll-deg to impact/
- if no <impact-reports> node is defined for a particular submodel, then
  write the path to /ai/models/model-impact instead
- don't tie() properties that are only ever set a single time, if at all!
- better variable names
2007-05-31 18:08:12 +00:00
mfranz
b0fd3deeb0 reverting a small part; shouldn't make a difference, though 2007-05-15 21:37:16 +00:00
mfranz
b727604591 drop /ai/models/ballistic[]/impact/signal node, and allow instead to define
a report node in the submodels config:

  <impact-reports>/sim/model/cow/impact</impact-reports>

When an impact happens, then the path of the submodel will be written to
this node. An attached listener function can evaluate the impact properties.
2007-05-15 19:45:41 +00:00
mfranz
4de2c7619a - add leading underscores to class member variables
- initialize ht_agl_ft with high value to avoid premature impact animation
- cosmetics
2007-05-15 17:22:49 +00:00
mfranz
7d5952b185 Vivian MEAZZA: add terrain collision for submodels on request
(set <impact>1</impact> in the submodel config)

mf: minor modifications & cleanup; more to come
2007-05-15 16:19:11 +00:00
mfranz
0a9d71ee51 Vivian MEAZZA:
- extract common parts of load() and loadAI() into setData()
- fix trigger handling for aircraft that set a not yet existing property
2007-05-12 10:39:56 +00:00
frohlich
4fe615fff5 Modified Files:
src/AIModel/AIBase.cxx src/AIModel/AICarrier.cxx
	src/ATC/AIEntity.cxx src/Cockpit/hud_rwy.cxx
 	src/FDM/Makefile.am src/FDM/flight.hxx src/FDM/groundcache.cxx
	src/Instrumentation/HUD/HUD_runway.cxx src/Main/Makefile.am
	src/Main/fg_init.cxx src/Main/main.cxx src/Main/renderer.cxx
	src/Main/viewer.cxx src/Main/viewer.hxx src/Model/acmodel.cxx
	src/Model/modelmgr.cxx src/Scenery/scenery.cxx
	src/Scenery/scenery.hxx src/Scenery/tileentry.cxx
	src/Time/tmp.cxx: Remove the scenery center handling.
	Osg has double valued transforms at any relevant place.
2007-05-05 08:08:24 +00:00
mfranz
3233ce8a44 Vivian MEAZZA:
"BUGFIX - fix initiation order - make sure that the AI Model list is
populated before we attempt to attach submodels."
2007-04-27 11:02:39 +00:00
mfranz
2621ba7a47 Csaba "Jester" HALASZ: radar fix & extension
- fix breakage due to former commit (AIManager.cxx, r1.72)
- make AI properties available in AIBase
- add <valid> property for animations/nasal scripts
- support more MP and AI targets
- add target select and altitude display
2007-04-04 09:51:41 +00:00
mfranz
b361105202 Csaba HALASZ: don't treat every entry in a scenario file as model entry,
especially those called <description>. This was responsible for the aircraft
at --lon=0 --lat=0.
2007-04-02 12:47:26 +00:00
mfranz
8a6c95451b allow AI models to contain <nasal><load> and <nasal><unload> blocks in
their XML wrapper/animation file. They can access their /ai/models node
via cmdarg() function. Example:

  <nasal>
          <load>
                  print("Hi, I'm the Nimitz. My data are under ",
                                  cmdarg().getPath());
          </load>
          <unload>
                  ...
          </unload>
  </nasal>

Note, however, that the <unload> block is only called on exit at the moment,
not when the tile is unloaded.
2007-04-01 12:39:20 +00:00
mfranz
bec023b43c Vivian MEAZZA:
"""
"Flight plans" which can start at a given time (gmt)

WAITUNTIL tokens which pause the flight plans until a given time (gmt)

Submodels can now be attached to any AI objects (except submodels - it can
be done, but in my experimental code it's too expensive in frame rate atm)

"No-roll" attribute added to Ballistic objects - useful for wakes and the
like

"Random" attribute added to Ballistic objects (adds =- 5% to the Cd) -
useful for smoke, exhausts

If the <trigger> tag is not specified the Ballistic object/s will be
released at start-up (cannot be stopped)

Submodels are not released from AI Objects if the AI Object is more than 15
miles away.
"""


mf: minor code and formatting fixes; submodels.?xx were FUBAR and are thus
    astyle formatted;

    NOTE that <name> tags END, EOF, WAIT, WAITUNTIL are *depreciated*.
    Don't get too used to them. This will have to be moved from the "name"
    to regular engries.
2007-03-30 22:51:52 +00:00
mfranz
002b880e7e Vivian MEAZZA:
"Implement 'flightplans' for AIShips. This patch also introduces the concept
of a 'WAIT' token for AIShips: when the flightplan reaches a 'WAIT', the
AIShip stops and pauses for the specified time (secs)."
2007-03-05 21:40:39 +00:00
mfranz
ce4360e157 Vivian MEAZZA: call AI models' ::reinit() methods on reinit 2007-02-26 11:47:04 +00:00
mfranz
98aa76ad33 Maik JUSTUS: fix bug that caused aircraft zombies on an MP player's last
position after he reset his fgfs
2007-01-28 11:40:56 +00:00
mfranz
c32ffcd3c9 Maik JUSTUS: add a missing pair of parens and rounding 2007-01-24 23:39:48 +00:00
mfranz
747b1e11cc Maik JUSTUS: fix bug in previous commit 2007-01-13 16:04:28 +00:00
durk
7299699903 Maik Justus,
Here is a patch for two bugs in the AI/multiplayer part:

1. Cannot find model file *.ac error message (was only a false message,
anything worked correctly, the model was loaded from the correct path
afterwards).

2. Often many multiplayer aircrafts are missing in the property-tree.
(but I need them for aerotowing). There is still another bug: The
property in some circumstances seems not to be cleaned up after logout
of a multiplayer. I have added a workaround for this, but I don't now,
if it 100% works (should have no side effects, just aerotow would not
work sometimes). For testing I need more traffic on the mp-server.
2007-01-13 09:04:07 +00:00
frohlich
6cf05270f5 Modified Files:
AIBase.cxx AIManager.cxx AIManager.hxx: Remove dead code.
	No ground intersection on AI models. Note that the carrier still
	reenables that nodemask.
2007-01-06 14:25:55 +00:00
fredb
462dd6900c Remove unused variables 2006-12-17 18:40:55 +00:00
durk
b34dc24bdc Maik Justus:
Here the patch that makes fg search for multiplayer aircraft in AI/Aircraft
first.
2006-12-17 08:00:14 +00:00
mfranz
c0e1a380d6 make sure the node for the AI model removal report exists;
addressing a node with its path is unsafe at that time
2006-11-26 12:02:06 +00:00
frohlich
2e32ccf393 Modified Files:
src/AIModel/AIMultiplayer.cxx: Apply longstanding patch from Maik
	Justus. Fix double aircraft.
2006-11-22 17:16:19 +00:00
durk
e389bed31f Fix for a crash reported by Maik Justus. 2006-11-14 20:08:50 +00:00
durk
33037b2139 AI Update:
- Ground network slow-down finally works as expected
   (although occasionally causing a traffic jam)
 - Hold position instruction now really sets speed to zero, in addition
   it actually works now for crossing and two-way traffic
 - Attempt to limit execution time of ground network trace algorithm
   to make performance acceptable at high-density networks
 - Removed remaining terminal messages
 - Various minor tweaks and clean-ups
2006-11-11 10:52:05 +00:00
frohlich
6b9d29194b Modified Files:
src/AIModel/AIBase.cxx src/Main/main.cxx src/Main/renderer.cxx
	Reflect last change in SimGear
2006-10-31 06:27:34 +00:00
mfranz
3bc199c59f ssgSharedPtr.hxx -> SGSharedPtr.hxx 2006-10-30 16:31:45 +00:00
frohlich
b0f9d24f9d Modified Files:
configure.ac src/AIModel/AIAircraft.cxx src/AIModel/AIBase.cxx
 	src/AIModel/AIBase.hxx src/AIModel/AICarrier.cxx
 	src/AIModel/AICarrier.hxx src/AIModel/AIManager.cxx
 	src/AIModel/AIManager.hxx src/ATC/AIEntity.cxx
 	src/ATC/AIEntity.hxx src/ATC/AIMgr.cxx src/ATC/AIMgr.hxx
 	src/ATC/ATCdisplay.cxx src/ATC/ATCdisplay.hxx
 	src/Cockpit/cockpit.cxx src/Cockpit/cockpit.hxx
 	src/Cockpit/hud.cxx src/Cockpit/hud.hxx
 	src/Cockpit/hud_rwy.cxx src/Cockpit/panel.cxx
 	src/Cockpit/panel.hxx src/Cockpit/built_in/FGMagRibbon.cxx
 	src/Cockpit/built_in/FGMagRibbon.hxx src/FDM/flight.cxx
 	src/FDM/groundcache.cxx src/FDM/groundcache.hxx
 	src/GUI/gui_funcs.cxx src/Input/input.cxx
 	src/Instrumentation/od_gauge.cxx
 	src/Instrumentation/od_gauge.hxx
 	src/Instrumentation/render_area_2d.cxx
 	src/Instrumentation/render_area_2d.hxx
 	src/Instrumentation/wxradar.cxx
 	src/Instrumentation/wxradar.hxx
 	src/Instrumentation/HUD/HUD.cxx
 	src/Instrumentation/HUD/HUD.hxx
 	src/Instrumentation/HUD/HUD_runway.cxx src/Main/Makefile.am
 	src/Main/main.cxx src/Main/renderer.cxx src/Main/renderer.hxx
 	src/Main/viewmgr.cxx src/Model/acmodel.cxx
 	src/Model/acmodel.hxx src/Model/model_panel.cxx
 	src/Model/model_panel.hxx src/Model/modelmgr.cxx
 	src/Model/modelmgr.hxx src/Model/panelnode.cxx
 	src/Model/panelnode.hxx src/Navaids/awynet.cxx
 	src/Scenery/Makefile.am src/Scenery/hitlist.cxx
 	src/Scenery/hitlist.hxx src/Scenery/newcache.cxx
 	src/Scenery/scenery.cxx src/Scenery/scenery.hxx
 	src/Scenery/tileentry.cxx src/Scenery/tileentry.hxx
 	src/Scenery/tilemgr.cxx src/Scripting/NasalSys.cxx
 	src/Scripting/NasalSys.hxx src/Time/light.cxx
	Big BLOB on the way to OSG.
2006-10-29 19:30:21 +00:00
mfranz
bdf16b7b7e use correct data type for string::find() 2006-10-17 21:21:26 +00:00
mfranz
cc3ad61175 cerr don't belong in CVS
use SG_LOG! use SG_LOG! use SG_LOG! use SG_LOG! use SG_LOG! use SG_LOG!
use SG_LOG! use SG_LOG! use SG_LOG! use SG_LOG! use SG_LOG! use SG_LOG!
2006-10-12 22:12:09 +00:00
frohlich
8a67faaf5a Modified Files:
src/AIModel/AIMultiplayer.cxx src/MultiPlayer/mpmessages.hxx
	src/MultiPlayer/multiplaymgr.cxx
	src/MultiPlayer/multiplaymgr.hxx src/Network/multiplay.cxx
	Apply Stuart Buchanan's multiplayer property/chat patch.
2006-10-10 05:17:07 +00:00
durk
666910a793 Major update of traffic manager and AI related airport facilities.
- Moved AIModels/Traffic Manager related AI functions to a new file
- Rewrote the traffic manager so that the containers use pointers to
  objects instead of the objects themselves, which will allow for a
  more flexible memory management.
- Rewrote parts of the airport groundnetwork code, also because the
  stl containers now contain object pointers instead of the objects
  themselves.
- Fixed an uninitialized iterator in the AI distance tracking code
- Fixed flawed logic in some of the traffic controller's while loops
- Added a tower controller, which paces take-off behavior of AITraffic
  in a more realistic way.
- Various other minor fixes and fine tuning.
2006-10-06 17:36:31 +00:00
durk
8de6a69e3e Adding some more intelligence to the AI system step 2: Added a system to
detect interfering taxi routes and added a "hold position" instruction to
make one of two conflicting aircraft wait until it's route is cleared again
2006-09-19 17:04:22 +00:00
durk
5b2e16ca73 Ground network distance tracking code. AIAircraft taxiing at airports
maintain a resonable distance from each other while taxiing on the same
route. The current code does not yet take crossing routes or aircraft
taxiing into opposite directions into account.
2006-08-26 07:22:20 +00:00
fredb
905f5a1029 Better encapsulation for personality 2006-08-25 22:16:31 +00:00
curt
fe86900e57 Make the vertical acceleration rate scale with vertical performance. The
default case for tankers should still be right about the same as where it was.
2006-08-20 23:38:38 +00:00
mfranz
371419acbf warnings-- 2006-08-08 18:40:18 +00:00
frohlich
13ce1e48fb Make better use of SGMath 2006-08-08 17:57:33 +00:00
fredb
e35afbdec7 Suppress warnings : remove unused local variables. Use correct, initialized, variables. 2006-07-30 21:04:29 +00:00
durk
8c2e595ff0 Spectacular improvement in traffic manager initialization and preparatory
work for ground based distance separation of AIAircraft.

Traffic manager initialization related changes:
- Schedules initialize "on the fly", instead of during initialization
- Invalid routes are no longer deleted, but marked as BOGUS and ignored
- Changed loading order from a distance based prioritization to a point-
  score based prioritization, resulting in a much faster establisment of
  AIAircraft near the user's plane.

Preparatory work for ground-based separation of Aircraft.
- The groundnetwork findShrortestRoute function not only returns a list
  of waypoints, but also a list of taxi "segments" (a.k.a. taxiways).
- The taxiway list is stored in the Flightplan, and updated everytime
  a new taxi leg is created.
2006-07-29 18:17:19 +00:00
durk
402046e580 AI Modifications: 1) Added a patch that takes ground speed into consideration
using Curt's new speed adjustment code. 2) Separated the function
FlightPlanCreateCruise() into a new source file in preparation of a more
elaborate airway following scheme.
2006-07-27 14:42:15 +00:00
curt
5fc834f7f5 Attempt to shore up the numerical stability of the AI aircraft movement
computations.  This is probably not needed, but use double's consistently.
2006-07-27 02:27:43 +00:00
curt
1c2a3cc5ac White space ... 2006-07-27 02:26:30 +00:00
curt
f9badcf329 Remove side-slip (aka beta) from the heading offset of the target aircraft.
This is already accounted for in the true heading of the aircraft.
2006-07-27 02:25:58 +00:00
curt
674df0c4cd Add a "ufo" performance entry for the AI Aircraft. This gives very agressive
accel/decel and climb/decend performance which is useful for some scripting
scenarios.
2006-07-12 19:10:35 +00:00
curt
e7ed073c68 - Make two variable name modification to clarify units: altitude -> altitude_ft
and tgt_altitude -> tgt_altitude_ft.  Also fix a comment in AIBase.hxx
  indicating that the altitude is in meters, even though the usage throughout the
  code was most definitely feet.

- In AIMultiplayer.cxx, update the altitude_ft variable so that the altitude
  is reported correctly in the entity's property subtree.

- In AIMultiplayer.cxx, compute a velocity value in kts to fill in the speed
  entry in the entity's property subtree.  Note, this is not an earth centered
  reference speed, not an indicated speed and not a speed relative to the local
  airmass (that would be much harder to do.)
2006-06-24 00:00:27 +00:00
curt
4fade5839e Add a flag that allows the simulator to force "radar" computations even if
AI aircraft are out of range or the piloted aircraft has no radar system.

These computation include range, bearing, and angular offset relative to the
piloted aircraft.  This gives some external script the control the behavior
of the AI aircraft relative to the piloted aircraft without requiring a radar
system, and without requiring the AI aircraft to be within radar range.
2006-06-16 19:10:20 +00:00
curt
943b7b22a7 This patch only affects aircraft (AI Models) that have no predefined
flightplan.  Such aircraft are given some initial conditions that they
fly with.  They proceed on in "freeflight" mode indefinitely.  For example,
there is a refueling demo where the tanker starts at 3000', 280 kts, and
in a 15 degree bank, and then continues to orbit indefinitely.

For these aircraft with no flightplan, I have added several control nodes in
controls/flight that allow a script or menu or external application to set
heading, altitude, bank angle, and speed.  This permits some level of interactive
or scripted control over AI aircraft.
2006-06-16 14:22:21 +00:00