1
0
Fork 0
Commit graph

609 commits

Author SHA1 Message Date
frohlich
bb2e5fb2c9 Use the 'all but self' capability of the scenery elevaton code instead of
playing with node masks.

Modified Files:
 	src/AIModel/AIAircraft.cxx src/AIModel/AIBallistic.cxx
 	src/AIModel/AIBase.cxx src/AIModel/AIBase.hxx
 	src/AIModel/AIShip.cxx src/AIModel/AIShip.hxx
	src/AIModel/AIThermal.cxx src/ATCDCL/AILocalTraffic.cxx
2009-08-10 23:31:21 +02:00
Tim Moore
7d6c567fde Refer to property types using props:: namespace
BOOL, FLOAT etc. conflict with typedefs in windows.h.
2009-07-17 14:54:12 +02:00
timoore
4cc3084256 SGPropertyNode::Type moves to simgear::props namespace 2009-07-16 12:10:47 +02:00
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
fredb
c5a7267206 Compile again on Win32 platforms 2006-06-16 10:17:06 +00:00
frohlich
ef52b23e3a Make more use of SGGeod 2006-06-15 19:16:21 +00:00
frohlich
c2d8dcc18b More use of SGGeo[dc]. 2006-06-15 08:29:43 +00:00
mfranz
79abf11466 add Nasal/Listener hooks for adding/removing AI/MP models. Things like
MP chat or Nasal/xml based radar instruments need that. It uses fgSetString,
because this is in a very "cold path" and shouldn't clutter the AIBase.
2006-06-11 15:32:18 +00:00
frohlich
14fe03ba6f Modified Files:
src/AIModel/AIAircraft.cxx src/ATC/AILocalTraffic.cxx
	src/FDM/flight.cxx src/FDM/flight.hxx src/FDM/groundcache.cxx
	src/FDM/groundcache.hxx src/Main/fg_init.cxx src/Main/main.cxx
	src/Scenery/hitlist.cxx src/Scenery/hitlist.hxx
	src/Scenery/scenery.cxx src/Scenery/scenery.hxx
	Make use of the attached SGMaterial reference userdata on scenegraph
	leafs. Make the SGMaterial pointer available to the ground query
	routines.
2006-06-11 13:34:18 +00:00
mfranz
e48967cb1d fix another crash on exit by finally converting the rest of unguarded
SGPropertyNode to guarded ones. This is also done for JSBSim/JSBSim.hxx,
for which JSB had given explicit permission a while ago. I postponed that
back then, but now is the time.
2006-06-11 10:21:10 +00:00
mfranz
942561d64c - remove trailing spaces
- fix many cases of broken indentation (but not all)
- unify indendation
- ...
2006-06-09 18:48:57 +00:00
mfranz
4db6e924fe Vivian MEAZZA:
" Make a couple of minor adjustments to Harald's weather radar code, make
elevation work in the radar code, and add station ident to the TACAN code"
2006-06-09 18:29:51 +00:00
mfranz
4f17b48e83 - use guarded pointer for (unused) refuel_node
- comment out refuel_node->setBoolValue()  (as it was in the original patch :-)
2006-05-26 05:23:40 +00:00
mfranz
d47e4ce0bd Vivian MEAZZA:
"Bug Fix - amend the code so that JSBSIm can have more than one tanker in
the environment at the same time. A nasal script has to be added to each
aar-capable JSBSim model to complete this fix."
2006-05-22 20:18:40 +00:00
mfranz
f5955a9cab Vivian MEAZZA:
"Add Air to Air TACAN and User-User refuelling over the Multiplayer Network.
With this change, your TACAN instrument can be tuned to the channel of a
Multiplayer ac. It also activates fuel flow between User and User aircraft
when they are less than 50 ft apart. To participate in multiplayer as a
tanker, all you require to do is to use the callsign MOBIL* (where * is some
number) on the net. Only MOBIL1, MOBIL2 and MOBIL3 have been assigned TACAN
channels, but any MOBIL callsign will be able to give fuel."
2006-05-18 16:59:04 +00:00
mfranz
d9ee19d6cc - remove trailing spaces
- fix ridiculous mixture of 2-space-, 3-space-, 4-space-, tab-indents,
  and ~K&R & (braindead) FSF coding style
2006-05-13 10:02:17 +00:00
mfranz
db22f457b5 Vivian MEAZZA:
"Preparations for an upgrade to Air-to-Air Refuelling to allow more than one
tanker in the environment at a time. This will only work with YASim models.
JSBSim models are unaffected by this change."
2006-05-13 09:06:57 +00:00
curt
f9edbf3620 Dave Culp:
I've got some updates for the soaring scenario that will make for a more
realistic (and fun) experience.  They are:

1)  A cap cloud, which will sit atop each thermal
2)  A thermal scenario with wide coverage around KSFO, and using cap clouds
3)  A one-line change to AIThermal.cxx to position cap cloud properly
4)  Schweizer 2-33 set file change to match cloud coverage with thermal
heights.

files:

1)  data/Models/Geometry/thermalcap.ac
2)  data/Models/Geometry/thermalcap.xml
3)  data/Models/Geometry/thermal_cap.rgb

4)  data/AI/thermal_demo.xml

5)  data/Aircraft/sgs233/sgs233-set.xml

6)  source/src/AIModel/AIThermal.cxx
*** or, if you prefer diffs ***
7)  aimodel.diff
2006-05-02 01:19:02 +00:00
mfranz
b6cf140f98 Vivian MEAZZA:
"Add Air to Air TACAN. With this facility TACAN equipped aircraft can
measure the range and bearing of TACAN equipped AI Aircraft. ATM there is
only one assigned - callsign ESSO1 on TACAN channel 039X, but this can be
easily expanded to include other c/s channel # pairs - just ask me if you
want more."
2006-04-19 17:36:41 +00:00
durk
6f7a9a5b1b Fix for an AIFlightPlan initialization problem in the traffic manager. 2006-03-29 18:36:21 +00:00
durk
ad7a6736d7 Just commenting out a few error print statements, which I had overlooked. 2006-03-26 21:42:47 +00:00
durk
3c738b5cee Bugfix in the ai initialization randomization procedure. Randomly
removing waypoints could cause the AIFlightPlan to run out of waypoints.
This patch prevents that by retaining at least two waypoints.
2006-03-26 21:40:35 +00:00
durk
101ca14a6d Bugfixes and feature improvements related to AI auto flightplan generation.
When AIFlightPlanCreateTaxi() function is called with the firstFlight
argument set to true, this is supposed to handle situations where the
the aircraft's timetable indicates it should have left between about 5 to
20 minutes earlier. In the previous version, all these aircraft started
taxiing from the first parking location available in the network, due
to the fact that the variable gateId was not assigned a value. In this
patch, route tracing starts from an assigned gate and the network node
following code is fast forwarded to a random location along the taxiways
to give a more realistic and natural distribution of taxiing aircraft
after startup.
    This patch further addresses some weird ballet-dancing behavior that
aircraft were showing just prior to/right after parking and which was
related to a number of more or less duplicate waypoints in the transition
from createTaxi() to createParking() to createPushBack() to createTaxi().
    Finally, a blatant typing error in the getParking() function was fixed.
2006-03-19 07:41:48 +00:00
mfranz
0c92519754 Vivian MEAZZA & Mathias FROEHLICH:
"Add new code for animating JBDs. Tidy up code for animating flightdeck
elevators."  (JBD ... Jet Blast Deflectors, but everyone knows that :-)
2006-03-18 16:31:09 +00:00
durk
f8eb3d4309 Bugfix: Non-existent AIModels could trigger a request to load scenery tiles
at (lon, lat) coordinates -1000,0. This patch fixes the AIModels/Traffic
Manager side of things. The AIModels subsystems allowed the creation of
AIAircraft with non-existent 3D models. If such a model didn't exist, the
aip class didn't get initialized, resulting in the above-mentioned bogus
position information. Here I circumvent this problem by a) only interacting
with the tile loader if the model is visible (and hence has succesfully been
initialized) and b) by disallowing the traffic manager to create AIAircraft
objects if the path to the 3D model doesn't exist.
2006-03-11 18:14:48 +00:00
mfranz
c386f00312 I take that back. This doesn't work yet. :-) 2006-03-09 11:23:15 +00:00
mfranz
5ebd1a18f3 add <load>/<unload> support to AI models, including aircraft models. For
aircraft models this is only called if they are loaded as AI, not if they
are the model flown by the human pilot. This has technical reasons (too
soon for Nasal/fg), but is useful to distinguish AI and non-AI use, for
example to set a different livery for AI models, or to set different
animation properties.
2006-03-09 11:14:16 +00:00
ehofman
479d4d7484 Mathias Frhlich:
Fix the AI-Radar code.
2006-03-04 12:49:30 +00:00
durk
395ea07252 Bugfix: variable fp was deleted in both AIBase::~AIBase() and AIAircraft::AIAircraft(), resulting in a segmentation fault.
Here the delete fp; statement is removed from the AIAircraft() destructor.
2006-02-23 21:42:11 +00:00
mfranz
c9813d1b5d new FSF address 2006-02-21 01:16:04 +00:00
ehofman
5fe860750e Mathias Frhlich:
This patch makes use of the vectors now available in simgear with that past
patch. And using that it simplyfies the carrier code somehow.

- Small additional factory's to the quaternion code are done in the simgear
  part. Also more explicit unit names in the factory functions.
- The flightgear part makes use of them and simplyfies some computations
  especially in the carrier code.
- The data part fixes the coordinate frames I used for the park positions in
  the carrier to match the usual ones. I believed that I had done so, but it
  was definitly different. Also there are more parking positions avaliable now.
2006-02-19 17:28:31 +00:00
fredb
36e4045810 Add missing include files needed by the new math code under windows 2006-02-18 13:58:09 +00:00
ehofman
da6568ad50 Mathias Frhlich:
The new multiplayer patch with an extension to transmit some properties with
the base package. The properties are transmitted in a way that will not
immediately brake the packet format if we need new ones.
Even if the maxmimum number needs to be limited somehow, that format might
work well until we have an improoved packet format which is even more compact
and that does not require to retransmit redundant information with each
packet.

That part is relatively fresh and based on that what Oliver provides on his
multiplayer server web page.

The properties are transferred to the client and I have modified the seahawks
rudder animation property to use a relative property path to verify that it
works appart from the fact that you can see it changing in the property
browser.

The movement is still a bit jerky, but that can be fixed/tuned later without
again braking the packet format.
2006-02-17 09:43:33 +00:00
ehofman
3894dc75a7 Remove empty files. 2006-02-11 13:57:40 +00:00
ehofman
4bfd1722df Mathias Froehlich:
This patch removes some useless indirection when creating AIModels. It
obsolets AIScenario*.

AIEntities are just an intermediate copy of an other intermediate copy of an
xml file on the way from the ai scenario configuration file to the AIModels.
As such the AImodels can now be created directly from the property tree read
from the scenario file.

This reduces the amount of work needed to add an other AIModel and reduces the
amount of copy operations done during initialization.

It also moves internal knowledge of special AI models into these special AI
models class instead of spreading that into the whole AIModel subdirectory
which in turn enables to use carrier internal data structures for carrier
internal data ...

Also some unused variables are removed from the AIModel classes.
I believe that there are still more of them, but that is what I stumbled
accross ...

Tested, like the other splitouts these days in a seperate tree and using the
autopilot for some time, and in this case with a carrier start ...
2006-02-11 13:16:56 +00:00
ehofman
5bd2ef1edb Vivian Meazza:
This patch is a combined effort by Gregor Richards, Oliver Schroeder, and
Vivian Meazza (and code cleanups and improvements by Erik Hofman). It corrects
the bug in which a Multiplayer model responds to local inputs, and the view
number bug which caused certain aircraft to appear as cockpit only models. It
passes remote properties over the net, and all major control surfaces and gear
are now animated correctly, providing that the local ~model.xml file contains
no leading "/" in the <property></property> data entries. MP objects
are now extrapolated using 1st and 2nd derivatives to make their movement
appear more smooth. The sim is now halted while a new client joins the net.

Known problems with MP are non-display of the remote client under certain
circumstances of starting/resetting, and a freeze on starting. These bugs are
long standing, and are not addressed by this patch.

Special thanks must go to AJ Macleod for his patient testing of this patch over many evenings.

We have also moved part of multiplayer into AIModels as part of the ongoing
development of MP.
2006-02-09 12:29:05 +00:00
ehofman
a47725e92f Mathias Frhlich:
Make use of the automatic reference counting class for ssg* data in flightgear.
2006-02-08 10:25:56 +00:00
mfranz
d1ad73558f Vivian MEAZZA:
"Implement the repeat function for submodels. Default value is 'false' "
2006-01-30 22:08:53 +00:00
ehofman
bd1f711b51 Durk Talsma:
- Feet to meter conversion mistake (in AI getGround elev)
- Improved ground following code (not yet perfect, but for now no one will
  notice it within the marginal altitiude differences at the taxitrack or
  runway)
- Exclusion of the "AI" directory witihin data/Aircraft in
  main/init/fgSearchAircraft, to prevent AI aircraft to be picked up by the
  aircraft search function
2006-01-30 13:29:49 +00:00
ehofman
713ddd05dd Olaf Flebbe: Make sure the model gets deleted when it's not referenced anymore. 2005-12-30 09:34:29 +00:00
ehofman
4be621fbe9 Durk Talsma, Olaf Flebbe & Mathias Frhlich:
Split up simple.cxx
2005-12-29 13:58:21 +00:00
mfranz
1caefda2a0 - fix typos
- fix indentation (there were 2, 3, 4, 7(!) space indents as well as tab
  indents, all mixed together)
- no code changes, except one "if (foo) {}" changed to "if (!foo) return; ..."
2005-12-08 15:03:08 +00:00
mfranz
9c28ed0257 Vivian MEAZZA:
"Remove redundant code, tidy up and improve output properties"
make elevator work
2005-11-29 16:38:49 +00:00
mfranz
03bf631765 ban not so informative message 2005-11-28 10:18:39 +00:00
ehofman
388ddb244f Mathias Frhlich:
While digging in flightgears lost memory, I found that endless loop.
2005-11-27 09:50:26 +00:00
ehofman
9df7af3924 David Culp:
Here's a fix for a bug I introduced when I updated the AIStorm with
turbulence.  The change I made to the FGAIEntity struct was overriding the
thermal <strength-fps> data.
2005-11-16 15:23:18 +00:00
mfranz
853d19e09b Harald JOHNSEN:
"the model is deref'd and deleted when the refcount is null *but* it is
still referenced in the ai model list, so next time you ask for it you will
have a reference on something deleted"
2005-10-30 10:50:36 +00:00
ehofman
b24dbb3f8b Alex Romosan:
I tried to make sure accessor functions which return by reference act
on const objects. also replaced some iterators with const_iterator
and a few return/pass by reference that were missed the first time
around.
2005-10-26 09:03:49 +00:00
ehofman
62a359cc4a Alex Romosan:
* Use "const string&" rather than "string" in function calls when appropriate.
* Use "const Point3D&" instead of "Pint3D" in function calls when appropriate.
* Improved course calculation in calc_gc_course_dist()
* Safer thread handling code.

Vassilii Khachaturov:

Dont use "const Point3D&" for return types unless you're absolutely sure.

Erik Hofman:

* Use SGD_(2)PI(_[24]) as defined in simgear/constants.h rather than
  calculating it by hand every time.
2005-10-25 13:49:55 +00:00
mfranz
abf558620b this may be informative on first sight, but not when output in a loop 2005-10-22 19:33:32 +00:00
ehofman
54594e5219 Durk Talsma:
Auf Niederlandisch:
Bij deze de patch voor de taxiway code. Deze code is nog gebaseerd
op de bestaaande architectuur, gebaseerd op de FGAirport class in simple.[ch]xx
Ik heb me voornamelijk gericht op nieuwe functionaliteit; de volgende
submissie zal waarschijnlijk bestaan uit opschoning, opsplitsing en een
implementatie van de nieuwe airport architectuur, zoals voorgesteld door
David Luff.

En Anglais:
Here is the patch for the taxiway code. This code is still based on the
exsisting architecture, which is based on the FGAirport class in simple.[ch]xx
I've aimed mostly at new functionality; The next batch will probably contain
code cleanups, splitups and the implementation fo the new airport architecture,
as proposed by David Luff.
2005-10-18 18:44:37 +00:00
mfranz
13945c6cd4 Mathias Froehlich: fix refcounting problem that caused submodel crashes 2005-10-18 18:01:43 +00:00
ehofman
5c0dbf7b65 Don't use the this pointer for referencing the AIModels anymore, this
turns out to get problematic on 64-bit systems. Instead use a regular
int based approach.
2005-10-15 14:55:51 +00:00
ehofman
54a33c3899 Mathias Frhlich:
I had a quick view over the ssgBase::ref() calls in flightgear.
I made them all symmetric and used ssgDeRefDelete to dereference them.
This has the basic advantage that ssgDeRefDelete additionaly deletes the
memory instead of just decrementing the reference cound without deletion ...

This includes an incorrect deref instead of a ssgDeRefDelete in the placement
transform registration I introduced earlier. I believe that this causes the
problems with long flights (unverified, but with a big propability).
2005-10-15 14:51:52 +00:00
ehofman
f057fd0d48 Martin Spott: Use standardized Sun directive. 2005-10-06 11:08:26 +00:00
ehofman
1c3e2d4942 Vivian Meazza:
This adds a TACAN instrument to the inventory. Range and bearing are calculated
to the TACAN or VORTAC beacon selected by means of the Channel Selector in the E
quipment/Radio pull-down menu.

A TACAN beacon has also been added to the aircraft carrier Nimitz (channel #029Y
).
2005-10-01 09:56:53 +00:00
ehofman
fad67bda10 Mathias Frhlihlich:
There was a patch from Manuel Masing a few months ago which cleaned up
SGLocation's way depending on input values. That means that with that patch
SGLocation does no longer have calls with unneeded input arguments.
I took his patch and integrated that into flightgear and made maximum use of
that changes.


Erik Hofman:
Remove some duplicate code that was moved to simgear/compiler.h
2005-09-05 13:25:09 +00:00
ehofman
99276dd060 MSVC fix. 2005-08-18 09:17:39 +00:00
ehofman
b92f034550 Vivian Meazza:
Some quite extensive changes to the AIModel code:

1. Mathias has made major changes to the AICarrier code to provide better
alignment of an aircraft on deck with the carrier - this feature is a major
improvement on the existing, but has a bug which might cause it to fail when
the computer carries out other tasks - changing window size is a known
example. This bug is outwith this code.

2.  I have made significant changes to the AIShip code to enable a ship the
turn and roll smoothly.

3. I have added some simple AI which enables the carrier to remain within,
or return to, an operating box.

4. An automated turn into wind for flying operations.

5. A simplistic implementation of TACAN within AICarrier. I am in the course
of implementing this as a generic instrument, but this is some time off
completion.
2005-08-16 09:37:23 +00:00
ehofman
7b824755ee Mathias Frhlich:
I have prepared a patch that:
- Introduces a FGTileMgr::scenery_available method which asks the tilemanager
  if scenery for a given range around a lat/lon pair is already loaded and make
  use of that method at some -9999 meter checks.
- Introduces a FGScenery::get_elevation_m method which queries the altitude at
  a given position. In constrast to the groundcache functions this is the best
  choice if you ask for one *single* altitude value. Make use of that thing in
  AI/ATC classes and for the current views ground level. At the current views
  part the groundcache is reused if possible.
- The computation of the 'current groundlevel' is no longer done on the
  tilemanagers update since the required functions are now better seperated.

Alltogether it eliminates somehow redundant terrain level computations which
are now superseeded by that more finegrained functions and the existence of
the groundcache. Additionally it introduces an api to commonly required
functions which was very complex to do prevously.
2005-08-14 12:57:12 +00:00
ehofman
15f3ef3cfb Harald JOHNSEN:
- AIManager.cxx :
  - we can now have multiple <scenario> entries in the sim/ai entry in preferences.xml
- AIBase.cxx :
  - added an exception handler around the loading of the 3D model to not exit FG
    if the model is not found
- AIScenario.cxx :
  - removed a duplicated read of the xml file, this was also exiting FG is the xml file
    does not exist
2005-07-24 14:05:28 +00:00
ehofman
1869b30b58 Mathias Frhlich:
I have traced that reset on carrier problem down to several problems. One of
them is the fact that on reset the carrier is updated while the aircraft is
not. That made the aircraft drop down an elevator sometimes. Depending on the
passed realtime while loading some parts of the scenery.
2005-07-13 12:25:16 +00:00
ehofman
4df7a3e9f8 Mathias Frhlich:
I have introduced the posibility to start directly on the carrier.

With that patch you will have a --carrrier=id argument where id can either be
the pennant number configured in the nimitz scenario or the carriers name
also configured in the carriers scenario.
Additionaly you can use --parkpos=id to select different positions on the
carrier. They are also configured in the scenario file.

That includes the switch of the whole FGInterface class to make use of the
groundcache.
That means that an aircraft no longer uses the current elevation value from
the scenery class. It rather has its own local cache of the aircrafts
environment which is setup in the common_init method of FGInterface and
updated either manually by calling
 FGInterface::get_groundlevel_m(lat, lon, alt_m);
or implicitly by calling the above method in the
 FGInterface::_updateGeo*Position(lat, lon, alt);
methods.
A call get_groundlevel_m rebuilds the groundcache if the request is outside
the range of the cache.

Note that for the real usage of the groundcache including the correct
information about the movement of objects and the velocity information, you
still need to set up the groundcache in the usual way like YASim and JSBSim
currently does.
If you use the native interface, you will get only static objects correctly.
But for FDM's only using one single ground level for a whole step this is IMO
sufficient.

The AIManager gets a way to return the location of a object which is placed
wrt an AI Object. At the moment it only honours AICarriers for that.
That method is a static one, which loads the scenario file for that reason and
throws it away afterwards. This looked like the aprioriate way, because the
AIManager is initialized much later in flightgears bootstrap, and I did not
find an easy way to reorder that for my needs. Since this additional load is
very small and does only happen if such a relative location is required, I
think that this is ok.

Note that moving on the carrier will only work correctly for JSBSim and YASim,
but you should now be able to start and move on every not itself moving
object with any FDM.
2005-07-03 09:39:14 +00:00
mfranz
9f0397a720 - replace one SGPropertyNode* by SGPropertyNode_ptr to avoid crash with
temporary removeChild(); should be done even after reverting; the node
  is accessed after removal
- cleanup:  if (foo) delete foo  -->  delete foo
2005-06-30 18:34:20 +00:00
ehofman
ab83702c16 David Culp:
I added an AIStatic object to my OV-10 sim for use in putting city signs,
vehicles, or anything else that will be static, but that I don't want to put
in the scenery files.  It's inexpensive.  Before, I was making such things
from AIShip.

I also added the ability to set flight plans to repeat, so that when an
airplane reaches the end it just starts over at the beginning.  This is
useful for my OV-10 sim.  I have C-141 and KC-135 traffic flying approaches
to Ramstein, and I only have to define two AI objects to do this.

Also, I found an inefficiency in AIBase, where every AI object was calculating
Mach number at every dt.  Now only AIBallistic objects do this.
2005-06-04 09:38:52 +00:00
ehofman
9c146d5527 MSVC fix. 2005-05-22 07:36:26 +00:00
ehofman
4b5a80129d David Culp:
1)  The AIStorm sets the properties:
         /environment/turbulence/magnitude-norm
         /environment/turbulence/rate-hz

    The actual turbulence effects are handled by the FDM.
    If the effects are deemed unrealistic, then that will
    have to be fixed in the FDM(s).


2)  The zone of turbulence is cylindrical, and is centered
    at the AIStorm's lat/lon.  The diameter is set with
    <diameter-ft>, the top with <height-msl>, the bottom is
    assumed to be at <altitude> minus 1000 feet.

3)  Note that the zone of turbulence may not match well with
    the visual model of the storm.  In this case I had to
    x-offset the storm model by 4700 meters to match the zone
    of turbulence. (i.e. the storm model is 4700m off center).

4)  While I was in there I also increased the speed of the
    lightning flashes to look more realistic.
2005-05-16 09:48:00 +00:00
ehofman
408dcc38b1 Solaris fixes 2005-05-07 08:56:42 +00:00
ehofman
2d9108e253 Add lightning support from David Culp. 2005-05-02 12:29:13 +00:00
ehofman
4c10ef139c Mathias:
I have done a patch to eliminate the jitter of 3D-objects near the viewpoint
(for example 3D cockpit objects).
The problem is the roundoff accuracy of the float values used in the
scenegraph together with the transforms of the eyepoint relative to the
scenery center.

The solution will be to move the scenery center near the view point.
This way floats relative accuracy is enough to show a stable picture.

To get that right I have introduced a transform node for the scenegraph which
is responsible for that shift and uses double values as long as possible.
The scenery subsystem now has a list of all those transforms required to place
objects in the world and will tell all those transforms that the scenery
center has changed when the set_scenery_center() of the scenery subsystem is
called.
The problem was not solvable by SGModelPlacement and SGLocation, since not all
objects, especially the scenery, are placed using these classes.

The first approach was to have the scenery center exactly at the eyepoint.
This works well for the cockpit.
But then the ground jitters a bit below the aircraft. With our default views
you can't see that, but that F-18 has a camera view below the left engine
intake with the nose gear and the ground in its field of view, here I could
see that.
Having the scenery center constant will still have this roundoff problems, but
like it is now too, the roundoff error here is exactly the same in each
frame, so you will not notice any jitter.

The real solution is now to keep the scenery center constant as long as it is
in a ball of 30m radius around the view point. If the scenery center is
outside this ball, just put it at the view point.

As a sideeffect of now beeing able to switch the scenery center in the whole
scenegraph with one function call, I was able to remove a one half of a
problem when switching views, where the scenery center was far off for one or
two frames past switching from one view to the next. Also included is a fix
to the other half of this problem, where the view position was not yet copied
into a view when it is switched (at least under glut). This was responsible
for the 'Error: ...' messages of the cloud subsystem when views were
switched.
2005-04-29 14:38:24 +00:00
ehofman
3b5512f573 David Culp:
I'm looking through the AI code, trying to find the bug that's killing the
thermals.  The following things don't look right:

1)  AIManager::101  ,   the Traffic Manager pointer is searched for by name at
every dt.   I'll leave this for you to look at.

2)  AIManager::295  ,  the thermal height is not being set.  We need to
restore the line:         ai_thermal->setHeight(entity->height_msl);
This fixes the thermal problem.

3)  AIManager::328  ,  I changed the fetching of the user state to occur every
sim cycle, and changed the fetching function from by-name lookup to a lookup
by node pointer.  It should be faster now, and more accurate too.  This helps
the air-refueling.
2005-04-19 12:52:26 +00:00
ehofman
d461e7868f Melchior FRANZ:
- don't treat *every* child in the xml as submodel, especially not a "param"
  block
- do not only *enable* the contrail flag above some altitude, but also
  disable it below
2005-03-31 08:54:04 +00:00
ehofman
50bdf6098a Mathias Frhlich:
I have done some cleanup where I moved some values out of classes where they
do not belong and such stuff.
Also the fols offsets are now named in the carrier xml file with a more
verbose name (flols-pos/offset-*) than before (only offset-*).
There is a little preparation for definitions of parking positions on the
carrier which should later be used for starting flightgear directly on the
carrier.
2005-03-19 09:57:18 +00:00
ehofman
7cc58da6a9 Vivian Meazza:
I attach the long-promised improved version of the USS Nimitz.

It includes an improved version of the FLOLS, which requires the attached
diff to be applied to AICarrier.cxx and AICArrier.hxx.

I've made lots of eye-candy in the form or the flightdeck crew.
Unfortunately, it about doubles the size of the tarball. I'll send it to you
later; when I've figured out some way of only loading on request (any advice
would be very welcome).

I could provide a \u2018bare\u2019 version to cut down on the vertex count for
less capable systems however, the count isn\u2019t huge in the first place.
I've cut the textures down as far as I can without losing definition.
2005-02-24 15:05:56 +00:00
ehofman
02a757f9e6 MSVC (warning) fixes. 2005-02-18 10:16:30 +00:00
ehofman
5bc15d7a69 Durk Talsma:
I just heard from John Wojnaroski that you and he are going to work on getting
a flightgear demo machine up for the linux expo thursday and Friday. John
indicated that he would very much like to get a CVS version with the new
traffic code up and running before the expo.
2005-02-10 09:01:51 +00:00
ehofman
a7139a816c Durk Talsma:
Fix a couple of places that were not yet using SGPath
2004-12-27 17:35:22 +00:00
ehofman
499c702ffb Mathias Frhlich:
We should now be able to find
wires or catapults when the ac3d model is loaded without the crease patch
(caused by the much more unstructured scene graph emitted by the old loader).
It should also emit more warnings if the carrier hardware configuration
includes conflicting definitions.
That code is the most intrusive one, it should not be used until you configure
an aircraft carrier as a aimodel. So I think it should be save to apply that
before the release too.
2004-12-27 13:21:18 +00:00
ehofman
afe94f63ea Remove some stale cout commands. 2004-12-27 13:19:28 +00:00
curt
222446df29 Replace the data/Airports/basic.dat.gz and data/Airports/runways.dat.gz with
a single apt.dat.gz file which is in the native X-Plane format.

To do this I wrote a front end loader than builds the airport and runway
list.  Some of the changes I needed to make had a cascading effect, so there
are minor naming changes scattered throughout the code.
2004-12-22 23:57:07 +00:00
ehofman
127e84cee9 Mathias Frhlich:
I have a small update which fixes the algorythm used for marking solid
surfaces for some cases where some branch nodes carry the object names I had
expected in the leaf nodes.
That will also introduce the possibility to mark whole subtrees from the
scenegraph solid.
2004-12-18 10:33:36 +00:00
ehofman
7a58ef58e7 MSVC fix 2004-12-05 09:34:03 +00:00
ehofman
8ba9f4e3a4 Vivian Meazza:
This is a sub-system which can be added to any carrier.

These files add a functioning Fresnel Lens Optical Landing System (FLOLS).
The orange/red 'source' lights are illuminated according to the position of
the pilot's eye above/below the 3.5 deg glide slope. The apparent position
of the source light relative to the fixed green datum lights allow the pilot
to 'fly the meatball'. The green 'cut' lights flash when the pilot's eye is
below the coverage of the lowest (red) source light.

TODO - add rules for the operation of the wave-off lights.
2004-11-30 12:34:11 +00:00
ehofman
c537267f96 Durk Talsma:
Okay, here's the latest update to the tarffic manager/AI Manager. AITraffic
can now fly multiple routes and be initialized while sitting statically at
airports.
2004-11-29 09:41:43 +00:00
ehofman
63c1f4b613 Mathias Frhlich:
This patch makes the aircraft carrier's hardware  appear in the scenegraph.
2004-11-26 10:24:48 +00:00
ehofman
3c0ab43b43 Mathias Frhlich:
The moving ai models will jump around realtive to the moving aircraft model.
I can see that with the carrier but others have noticed that too with ai
aircraft before.
The reason is that all SGSystems are called with a dt value which is not
necessarily a multiple of 1/hz.
In contrast, most FDM's use the _calc_multiloop function from FGInterface
which forces the time update to be a multiple of 1/hz for the FDM aircraft.
As a result, in the worst case, the FDM aircraft has moved nearly 1/hz seconds
further than the rest of flightgear (1/120sec*300kts that is about 1.3m).
That patch forces the time update to be a multiple of 1/hz.
2004-11-19 12:33:08 +00:00
ehofman
3142457537 Remove some changes I had put in to make it compile. those are no longer needed. 2004-11-16 19:48:09 +00:00
ehofman
9a8eaae03d commit some pending updates from Vivian 2004-11-16 09:33:21 +00:00
ehofman
2df4a3b685 Vivian Meazza:
I attach the latest version  of Nimitz. The textures have been improved. A glide-path has been added, it is on by default, but can be switched off by means of the properties browser: /ai/models/ship/controls/glide-path. The origin has been adjusted to the turning pivot and approximate roll center.

Modified AiShip files are also attached. These allow the radius of the turning circle of a ship to be input. The turning circle is adjusted for speed and rudder angle. Roll has been corrected so that a ship leans out of a turn, not inwards like an aircraft. The roll angle is adjusted for speed and rudder angle (yes, application of more rudder reduces roll angle - rudders act as stabilizers).


TODO

Add a relative wind calculation so that a carrier can be turned to the appropriate launch and recovery courses.

Add a 'flight plan' so that the carrier can carry out a racetrack for flight ops.

Add a projector landing sight.

Add auto-land facilities.
2004-11-13 14:45:57 +00:00
ehofman
85df309a3b David Culp:
Here are files to get automated contrails working.  I've set up contrails for
the 737, using my simple, untextured contrail model.  Vivian has made another
contrail model, but I'm still trying to get his to work.  I'm hoping others
will try to make contrail models also.

Here's some code that defines a top to thermals.  When the top of a thermal is
reached the strength is phased-out linearly over the next 100 feet of
altitude.  At first I tried just capping the thermal at the top, but the
change in thermal strength was too fast for the FDM to handle well.

Included is a new version of the thermal scenario that includes a top
(height-msl) to the thermal.  The default value is 5000 feet.
2004-11-07 14:46:21 +00:00
ehofman
4668174848 Move the submodels from the /systems proprty subtree into /ai instead. 2004-10-28 08:44:24 +00:00
ehofman
670ea7c881 David Culp:
Here's code to support a new AICarrier class, which I think will be
sufficiently different from a basic AIShip that it should have its own class.
2004-10-28 08:33:55 +00:00
ehofman
e5b1ab4831 Vivian Meazza:
As a result of recent requests, I've implemented the ability to switch off
aerodynamic stabilisation:

This has to be added to the submodel.xml files:

<aero-stabilised>false</aero-stabilised>

When false the submodel retains the pitch given at instantiation.

It defaults to true.
2004-10-28 08:29:15 +00:00
ehofman
29b5147478 Move the submodels code from the Systems manager into it's own Subsystem manager. 2004-10-22 09:58:24 +00:00
ehofman
3b62b16fe9 Comment out the unalias code also. 2004-10-21 09:27:40 +00:00
ehofman
7d1ec00a2b Frederic Bouvier:
I think I found the problem in props.hxx. I have an exception when copying properties. An alias to a property that has no value trigger this exception. The code that generate that is in AIManager.cxx  :

void FGAIAircraft::bind() {
   FGAIBase::bind();

   props->tie("controls/gear/gear-down",
              SGRawValueMethods<FGAIAircraft,bool>(*this,
                                             &FGAIAircraft::_getGearDown));

   props->getNode("controls/lighting/landing-lights", true)
          ->alias("controls/gear/gear-down");
}

controls/gear/gear-down has no value ( _type == NONE ) and controls/lighting/landing-lights is copied somewhere.


Erik:

Frederic's fix was to change props.hxx but he has expressed his doubts.
For now I've commented out the line that causes the problem so we have more
time to look deeper into the problem.

cvs -z4 -q diff -u props.hxx (in directory I:\FlightGear\cvs\SimGear\simgear\props\)
Index: props.hxx
===================================================================
RCS file: /var/cvs/SimGear-0.3/SimGear/simgear/props/props.hxx,v
retrieving revision 1.4
diff -u -r1.4 props.hxx
--- props.hxx	19 Sep 2004 09:08:12 -0000	1.4
+++ props.hxx	21 Oct 2004 07:10:54 -0000
@@ -622,7 +622,7 @@
   /**
    * Test whether this node contains a primitive leaf value.
    */
-  bool hasValue () const { return (_type != NONE); }
+  bool hasValue () const { return (_type != ALIAS && _type != NONE) || (_type == ALIAS && _value.alias->_type != NONE); }


   /**
2004-10-21 09:21:05 +00:00
ehofman
77d3a549a7 It's usually not a good idea to assign a const char* to a node of a temporary property tree, use string instead. 2004-10-14 09:49:46 +00:00
ehofman
1d081cdd93 Move the calculations of Mach to the base class. 2004-10-02 13:34:06 +00:00
ehofman
0304651a9b Add the Mach vaiable. 2004-10-02 12:05:59 +00:00
ehofman
1af8736df6 Vivian Meazza:
I've finished the variation of Cd with Mach number.
The calculations are only applicable to ballistic
objects, and then strictly one shape: non boat-tailed bullets/shells, so
I've put them in AIBallistic rather than AIBAase. For all inputs, Cd
should be the sub-sonic value, so bullets will need changing.

I've just posted a graphical analysis here:

http://myweb.tiscali.co.uk/vmeazza/FlightGear/cd_mach.pdf
2004-10-02 12:02:04 +00:00
ehofman
328053fe23 Vivian Meazza:
The calculation of submodel mass from weight has been moved from AIBallistic
to Submodel so that it is calculated only once, rather than on every
iteration as a present. The parameter <contents> has been added, primarily
so that droptanks will have the proper mass. It is the path to an
appropriate property containing a weight in lbs.

Care has to be taken with the use of <contents> because after a reset there
appears to be a delay in submodel instantiation (dt not properly reset???)
and the weight property is not always picked up before it is set to zero in
the key bindings. Slightly hard to explain. It works fine if FGFS has not
been reset though. There is a partial solution which involves the rejigging
of the fuel and gui nasal scripts, but there is still the visible delay in
instantiation to be resolved. I've nearly done the nasal fixes, which will
form part of an update to the Hunter only. I'll probably complete those
later today.
2004-09-27 14:24:20 +00:00
ehofman
1974be7faf Make the scenerio's work again (now for real) and a small number of updates. 2004-09-23 09:39:55 +00:00
ehofman
4b5d84d7fb Don't forget to unbind() before deleting the class. 2004-09-23 08:57:46 +00:00
ehofman
5570b16192 MSVC fixes. 2004-09-23 07:48:25 +00:00
ehofman
e0e5b325cb Vivian Meazza:
The value of rho (air density) varies with height. (Including the upper
stratosphere, ust in case someone wants to model ICBMs.) The standard
atmosphere is used (based on a sea-level temperature of 15 deg C.).


Erik Hofman:
I moved this code over the AIBase::update() so all AIModels can make
use of rho, temperature, pressure, etc.
2004-09-22 19:11:36 +00:00
ehofman
82dfd908b7 Make the scenarios work again. 2004-09-22 11:24:45 +00:00
ehofman
9d1b5164e2 fix a segmentation fault situation that is exposed at least on IRIX (but not Linux). 2004-09-22 10:03:26 +00:00
ehofman
26e6b0edcb Vivian Meazza:
I have added <Cd> and <weight> to the input parameters in the submodels.xml
script. Raw data may be used, thus avoiding the need to guestimate <eda>.
Eda remains, but should now be used to enter the proper cross-sectional
area.
2004-09-22 08:47:05 +00:00
ehofman
56f6d3b800 Fix a small number of potential problems. 2004-09-20 19:29:16 +00:00
ehofman
6d76e9da80 Vivian Meazza:
I had to reverse a number of signs to get it right. I took the opportunity
to add roll to the submodel so that droptanks will come off with the right
orientation. I have neither added the rotational speed to the submodel, nor
yaw, so if you release droptanks with  significant roll rate or yaw angle on
the aircraft the submodel will not be quite right. Straight and level, or
nearly so, is fine.
2004-09-17 16:32:58 +00:00
ehofman
2f581faf3e Vivan Meazza:
The maths, so far, is now correct. Roll and pitch are now both in the
correct sense. The aircraft velocity is added correctly to the
submodel velocity, and the submodel is now visible when instantiated.

However, the velocity is measured at the aircraft centre. To be totally
correct we ought to take into account the aircraft's rotational
velocity. We have pitch rate and roll rate available, but not yaw rate
(small anyway).
2004-09-14 08:27:55 +00:00
ehofman
c542be5330 Make sure the pointer is not being used after deletion, and tie the elapsed time to the particular class instance. 2004-09-08 14:02:25 +00:00
ehofman
9e72a38165 Rearrange ID related code. The (this) pointer is now the unique ID of the AIModel which fixes a number of problems along the way. 2004-09-08 13:21:40 +00:00
ehofman
af7c5e48be Internally keep track of the number of models per type. This really speeds up searching for the number of submodels of one type. 2004-09-07 19:56:22 +00:00
ehofman
d158c8168d Make use of a pointer to a structure to pass multiple parameters around. 2004-09-07 09:53:23 +00:00
ehofman
fed4a2c25a Vivian Meazza:
I've added another parameter to the submodel - wind.

It's activated by the entry <wind>true</wind> in the ../submodel.xml file.
If true, the submodel is affected by the local wind, otherwise not. The
parameter defaults to false. This is useful for exhausts and smoke, and
possibly all objects.
2004-09-05 09:45:34 +00:00
ehofman
1853012d90 Vivian Meazza:
Attached are the modified files to add buoyancy as a parameter for a
ballistic object. It may be set by adding

<buoyancy>x</buoyancy> to the submodel .xml file, where x is the appropriate
value (ft per sec2):

	32   neutral buoyancy - contrails
	>32  positive buoyancy - exhaust plumes
	(0   non-op - default value)

If <buoyancy>x</buoyancy> is not used, then there is no effect on the
current ballistic model
2004-09-01 08:32:54 +00:00
ehofman
d2d27f2d76 Tie the count into the property tree instead of using snprintf every frame. Add the life-timer to the property tree under sim/time/elapsed-sec for AI object animation (blending and/or scaling). 2004-08-30 11:13:29 +00:00
ehofman
af284e4bb9 David Culp: Here are small changes that allow one to set a life-span for submodels. 2004-08-30 09:11:59 +00:00
ehofman
cfc05f5f0d David Culp:
Silly me.  I was starting the timer at zero, so the first tracer didn't fly
until 0.25 seconds after pulling the trigger.  Now the timer starts at the
same value as "delay", so the first round comes out immediately.

Also, I've added an optional configuration attribute that allows you to change
the ballistics of the submodel.  This allows parachutes, or anything else
that has ballistics different from a bullet.  The attribute is called "eda",
which is the equivalent drag area.  Default value is 0.007, which gives the
same ballistics as the current tracers.  Increasing this value gives more
drag.  A value of 2.0 looks good for a parachute.


math stuff
########################################################################
The deceleration of the ballictic object is now given by:

[ (rho) (Cd) ] / [ (1/2) (m) ] * A * (V * V)

where rho is sea-level air density, and Cd and m are fixed, bullet-like
values. So the calculation is:

0.0116918 * A * (V * V)

The value "A" is what I'm calling the "eda" (equivalent drag area).
########################################################################


A parachute model will have to be built so that the parachutist's feet
are in the forward x-direction.
Here is the submodel.xml config I use for "parachutes":

  <submodel>
    <name>flares</name>
    <model>Models/Geometry/flare.ac</model>
    <trigger>systems/submodels/submodel[0]/trigger</trigger>
    <speed>0.0</speed>
    <repeat>true</repeat>
    <delay>0.85</delay>
    <count>4</count>
    <x-offset>0.0</x-offset>
    <y-offset>0.0</y-offset>
    <z-offset>-4.0</z-offset>
    <yaw-offset>0.0</yaw-offset>
    <pitch-offset>0.0</pitch-offset>
    <eda>2.0</eda>
  </submodel>
2004-08-26 16:25:54 +00:00
ehofman
72b201d96c David Culp:
The AIBase code was updated to fix an uninitialized pointer, and the
AIBallistic code has an improved FDM.
2004-08-21 12:24:54 +00:00
ehofman
025a1e2491 Durk Talsma:
I've included the latest fixes to the Traffic Manager/AI flightplan generation
code. Most of the code changes are in AIFllightplan.cxx. This is the code
that runs without depending on predefined FlightPlans in
#FG_ROOT/Data/AI/Flightplans.i

As suggested by Dave, I've also added a new property in
preferences.xml: /sim/traffic-manager/enabled, which is used to control
whether or not the traffic manager is active.

I'm still working on a few more 737 traffic patterns, those are going to take
a little longer, so I didn't want to wait sending in this code.

Finally, I haven't put much effort into ensuring "aeronautical correctness" in
this version yet. The code works on my system, but what the AI plane do may
actaully be quite rediculous. But I'd like to leave that for the next
version.
2004-07-22 18:50:29 +00:00
ehofman
dbfc0eb287 Put the sqrt() back in. That was part of another attempt to optimize the code, but it hadn't fully matured yet. 2004-06-12 11:37:47 +00:00
ehofman
c43e514e87 No need to do he calculations twice. FGAIBAse::update() handles them already. 2004-06-12 11:34:05 +00:00
ehofman
24820e6d5a Move the radar update code to the AIBase class. There seems to be a problem where all targets disappear whenever one of them disappears, but that was present in the previous update also. 2004-06-11 13:49:07 +00:00
ehofman
11290e8022 Remove an unnecessary property set. 2004-06-11 08:09:55 +00:00
ehofman
4fe886f008 Introduce a radar/in-range boolean property, end check this to see whether the CPU intensive radar calculations need to be done. If not, skip them. 2004-06-10 19:14:19 +00:00
ehofman
dda15ac488 David Culp:
Here's some additions to AI that allow refueling from an AI tanker (the actual
onload of fuel must be handled by the user's FDM of course, this just lets
the FDM know that the user is in position to refuel).

I've added a new class of AIAircraft called "tanker".  It uses the same
performance struct as a jet transport.  An AI tanker is just like an AI jet
transport, except it uses the already-existing radar data to control the
boolean property systems/refuel/contact.  The code change was minimal.

An AI tanker can be created like this:

  <entry>
   <callsign>Esso 1</callsign>
   <type>aircraft</type>
   <class>tanker</class>
   <model>Aircraft/737/Models/boeing733.xml</model>
   <latitude>37.61633</latitude>
   <longitude>-122.38334</longitude>
   <altitude>3000</altitude>
   <heading>020</heading>
   <speed>280</speed>
   <roll>-15</roll>
  </entry>

This puts a tanker over KSFO at 3000 feet, in a left-hand orbit.  When the
user gets within refueling range (contact position) then the property
systems/refuel/contact will be true.  Otherwise it is false.

The dimensions of the refueling envelope are pretty rough right now, but still
usable.  The user must be behind the tanker (ie. radar y_offset > 0).  The
user must be at or below the tanker's altitude (ie. radar elevation > 0).
The user's lat/lon must be within 250 feet of the tanker's lat/lon (ie. radar
range_ft < 250).  This last requirement is loose because the radar data is
only updated every 100 ms, which is accurate enough for radar use, but
which is sloppy for air refueling.  This could be tightened up by increasing
the radar update rate to once every sim cycle.

I'm going to add a light to the T-38 instrument panel that will monitor the
property systems/refuel/contact.  This will make it easier to explore the
boundaries of the refueling envelope.
2004-06-06 08:50:17 +00:00
ehofman
b3e9697262 Add the AIModel based air traffic subsystem from Durk Talsma. 2004-06-03 17:59:14 +00:00
ehofman
3c1a7174fb David Culp:
Here's some new AI stuff.

1)  AI objects must now be defined in a scenario file, not in preferences.xml
or a *-set file.  (Of course this doesn't prevent objects from being created
dynamically, as with Durk's traffic manager).

2)  A new demo_scenario file is attached.  It creates 3 aircraft, a sailboat,
and a thunderstorm.

3)  Objects without flightplans live forever.

4)  FGAIShip::ProcessFlightplan() is not yet implemented.

5)  preferences.xml should now define only <enabled> and <scenario>
2004-05-29 11:39:10 +00:00
ehofman
0074269d11 Fix a gxx 3.3 compiler problem. 2004-05-28 19:03:55 +00:00
ehofman
70a6f2c014 Use SGRawValueMethods rather than SGRawValueFunctions because that allows one to pass the 'this' pointer. Remove some debug code. 2004-05-28 08:46:33 +00:00
ehofman
b7acd97f2c Add the this pointer to the tied function calls. This makes it possible to make a distinction between the different aircraft models. 2004-05-27 13:16:53 +00:00
ehofman
20e35b175e Don't inline static functions. 2004-05-25 08:58:36 +00:00
ehofman
db22fb21c5 In the situation where a class gets deleted, the _slef pointer is set to 0. Make sure we check for that situation before using it. 2004-05-24 14:36:35 +00:00
ehofman
22cd6dfb2a David Culp:
1.  Removed aircraft roll on ground.
2.  Decreased descent pitch angle.
3.  Updated flightplans to include <on-ground>
4.  Fixed property indexing, so all AI aircraft have their own property branch


The default value of <on-ground> is false, so you only need to specify it when
on the ground.  For takeoff you need to specify <on-ground>true</on-ground>
for the first waypoint, and for the acceleration waypoint.  For landing you
need to specify it for the touchdown point and any taxi points.


One problem.  WARNING **** There is a bug in the way the property system
works, which causes a segfault, but I don't know if the problem is in the
property code, or in how I'm using it.  After an AI object terminates, if you
access the property tree through the property browser the sim will segfault.
2004-05-21 16:50:19 +00:00
ehofman
8beb280625 Oops, change type. 2004-05-19 14:10:31 +00:00
ehofman
4d3e523f90 Add AI models enableing/disableing command line option and support code. 2004-05-19 13:55:49 +00:00
ehofman
0fda8efa03 Reduce the update delay from 500 ms to 100 ms. 2004-05-19 08:12:21 +00:00
ehofman
eb0b1492a2 Fred found some iterated related problems. With a bit of luck this solves the segmentation fault problem. 2004-05-19 08:01:02 +00:00
ehofman
009fa7371d Some small updates that hopefully solve the segmentation fault at the end of the flightplan. 2004-05-18 09:09:08 +00:00
ehofman
0fd9f0a704 David Culp:
First, preferences.xml will define the scenario filename.

For now, the other way of defining ai objects still works, so the sailboat
stays in preferences.xml.  Later, I'll move the sailboat into the demo
scenario.  If no scenario filename is given, then no scenario will be
processed.

I changed the demo scenario to create two 737's, one takes off on runway 01L,
and the other takes off on runway 01R.  This will make a good demo for the ai
system.  One problem, if you takeoff on 28L/R right away, you might run into
the taking-off 737's, or be scared.
2004-05-17 08:45:33 +00:00
ehofman
c3c61ae657 Use lower case letters instead. 2004-05-15 12:46:25 +00:00
ehofman
1dfe93d550 David Culp:
Here's the newest AI stuff.

The AIManager at init() creates a new scenario.  Right now the
default_scenario is hard coded in, but eventually the AIManager should get
the scenario filename from preferences.xml.

The scenario defines which AI objects will be created.  Right now it only
creates AIAircraft, but this is easily extended.  The scenario also defines
which flightplan will be assigned to the airplane.  Scenario config files go
in data/Data/AI.

The Airplane gets a pointer to a FlightPlan object.  Each airplane should get
its own flightplan object, even if two airplanes have the same flight plan.
This is because  the flightplan maintains the iterator pointing to the
current waypoint, and two airplanes might be at different locations (for
instance if they were created at different times).  The flight plan files go
in data/Data/AI/FlightPlans.

When the airplane gets to the waypoint named "END" it vanishes.  The
AIAircraft destructor deletes its flight plan (if it has one).

The last waypoint is a place holder only.  I called mine
<WPT><NAME>"EOF"</NAME></WPT>.
2004-05-15 09:07:55 +00:00
curt
2acdd02879 Clean up various compiler warnings that have crept into the code. This
by no means get's them all, but it's a start.
2004-04-01 15:27:53 +00:00
ehofman
6a08c79fcc David Culp:
I added some things to the AI stuff to improve the AIThermal processing.
Before, all the thermals were processed in order, and the last one overwrote
the prior one.  Now, only the data from the nearest thermal is kept.  This
way a tile can be populated with many thermals, and (as long as they have the
same diameter) the one nearest the airplane correctly takes effect.  This
will make us ready for the next step, "auto-thermaling", where FlightGear's
tile manager can cover a tile with thermals, and set the thermal strength
based on land-use type.

I moved the enumerated object_type to the base class.  When an AI object is
created it now sets the _otype variable in the base class.  This lets the AI
manager find out what kind of AI object it is dealing with, using the base
pointer.  I also added a function isa() to the base class, so the manager can
process objects differently based on their type.

The AI manager now sends AIThermal processing to a different function, where
only the data from the nearest thermal is kept.  After the manager processes
all the AI objects, then the results from the nearest thermal are applied to
wind-from-down.
2004-03-07 12:08:46 +00:00
ehofman
250ccf7bff Put the Thermal and Storm support code back in 2004-03-03 20:33:08 +00:00
ehofman
ed4509d8b5 Put the AIStorm and AIThermal classes back in 2004-03-03 20:26:06 +00:00
ehofman
85a1e5cc98 David Culp:
Here's a new batch of AI code which includes a working radar instrument.

I put the radar calculations into the existing AIAircraft class.  It was
easier that way, and it can always be migrated out later if we have to.
Every tenth sim cycle the AIManager makes a copy of the current user state
information.  When the AIAircraft updates it uses this information to
calculate the radar numbers.  It calculates:

1) bearing from user to target
2) range to target in nautical miles
3) "horizontal offset" to target.  This is the angle from the nose to the
   target, in degrees, from -180 to 180.  This will be useful later for a HUD.
4) elevation, in degrees (vertical angle from user's position to target
   position)
5) vertical offset, in degrees (this is elevation corrected for user's pitch)
6) rdot (range rate in knots, note:  not working yet, so I commented it out)

and three items used by the radar instrument to place the "blip"

7) y_shift, in nautical miles
8) x_shift, in nautical miles
9) rotation, in degrees

The radar instrument uses the above three items, and applies a scale factor to
the x-shift and y-shift in order to match the instrument's scale.  Changing
the display scale can be done entirely in the XML code for the instrument.
Right now it's set up only to display a 40 mile scale.

The radar is an AWACS view, which is not very realistic, but it is useful and
demonstrates the technology.  With just a little more work I can get a HUD
marker.  All I need to do there is make a bank angle adjustment to the
current values.
2004-02-27 10:20:17 +00:00
ehofman
4b424a29e7 David Culp:
I went through the AI code to put the "bank" node back into the config file,
so the models can fly circles.  While I was in there I made some other
changes.

*)  Moved the initialization of roll, tgt-roll, pitch ... etc, from init()
into the constructor, so it wouldn't over-write the config settings.

*)  Changed the altitude getter to remove the meters-to-feet conversion.  The
altitude is kept internally in feet.  Only the scenery code needs meters.

*)  Added "bank" item for config file (for type=aircraft).  Left bank is
negative.

*)  Added "rudder" item for config file (for type=ship).  Left rudder is
negative.  Internally this is stored in the "roll" variable, but the ship
model doesn't roll.  It uses the "roll" variable for turning though.


The following puts a tanker at 3000 feet, 6 nm northwest of KSFO.  On takeoff,
the tanker is visible over the hanger building at one-o'clock.

   <entry>
    <type>aircraft</type>
    <class>jet_transport</class>
    <path>Aircraft/737/Models/boeing733.xml</path>
    <speed-KTAS type="double">320.0</speed-KTAS>
    <altitude-ft type="double">3000.0</altitude-ft>
    <longitude type="double">-122.455</longitude>
    <latitude type="double">37.69667</latitude>
    <heading type="double">200.0</heading>
    <bank type="double">-15.0</bank>
   </entry>
2004-02-23 20:55:07 +00:00
ehofman
863b0c9432 Make the AI models a bit more intelligent. The Gear should be extended and retracted automatically, the navigation lights turn on when sun-angle-rad > 1.57, strobe and beacon are always on and make sure all properties are returned in the right unit format. 2004-01-22 21:13:47 +00:00
ehofman
5a6858609d Fix a typo 2003-12-22 20:18:33 +00:00
ehofman
2d7a6e475d Split up model[] into ship[], aircraft[], ballistic[] and model[] (for unspecified models). 2003-12-22 12:30:35 +00:00
ehofman
298f53edef Tidy up the code a bit more, move /ai/model[] to /ai/models/model[] and make sure there can be more than one model subtree. 2003-12-22 10:24:15 +00:00
ehofman
c1eb54ae0a Use some C++ FOOmagic to get the lat and lon updated in the property tree properly 2003-12-21 22:16:57 +00:00
ehofman
9bc2517417 Make the AI model export it's internal state to the property tree under /ai/model[] using the same naming convention as used for the regular FDM. Also make sure the model animations are relative the the /ai/model[] node. 2003-12-21 20:12:55 +00:00
ehofman
4c01e0e76a Tidy up the code a bit 2003-12-21 13:42:01 +00:00
ehofman
a9c6ca26af Don't destroy the elements ourselves. Instead clear
() calls the destructor for each element itself.
2003-11-28 20:16:59 +00:00
ehofman
3297ac3544 Some small updates 2003-11-28 20:05:32 +00:00
ehofman
cd0c447b43 Add David Culp's AI model manager code which is derived from David Luff's AI/ATC code. 2003-11-28 15:48:05 +00:00