1
0
Fork 0
Commit graph

5356 commits

Author SHA1 Message Date
curt
62df58d4f8 I have added Aaron Wilson's virtual 3d runway projection to the HUD.
Aaron says:

I just got the virtual runway hud projection working on all views and
2D & 3D HUDs.  It is working awesome(see below).  I have attached every
file that was modified (hud.hxx, hud.cxx, and the default.xml for the hud)
and every file that was added (hud_rwy.cxx and runwayinstr.xml).

Just a quick overview of how the instrument works.

The virtual runway is projected by getting the "cockpit view" of the
runway in 3D and projecting the points on to the 2D HUD.  Therefore, the
virtual runway will be displayed the same in every view.  For example,
you can land an aircraft from the "Tower View" by flying the HUD.  Also
if you're in "Cockpit View" and it is centered then the virtual runway
lines will perfectly outline the actual runway.  I am getting the active
runway via the wind like done in the ATC classes, which may need changed.
Also, I made the assumption the view 0, in view manager, is always the
cockpit view, which may need changed as well.

The runway configuration file will allow you to specify a center offset
(x,y) and a bounding box (width,height).  You can also configure the line
stipple pattern for the outside and the center line.  For instance, if
you wanted a 0xFAFA pattern, then specify 64250 as the value.  If you
want a solid line, you can specify -1 or 65535 (0xFFFF) and zero will
turn the line off.  It also draws a runway indication arrow when the
runway is not in the HUD or it can be drawn all the time if arrow_always
is true.  The arrow will point in the direction of the runway (2D) by
rotating around the center  at a radius of arrow_radius.  If you wish to
turn the arrow off, you must set the arrow_scale <=0.  The arrow really
should be 3D arrow that points to the runway (or points in the direction
of the aircraft-to-runway vector).
2004-11-19 18:31:02 +00:00
ehofman
ddb15394ee Mathias FröhlichMathias Fröhlich:
Add some controls required for carrier operations:

/controls/gear/launchbar

should be 1.0 if the launchbar is lowered, that means the aircraft should now
be arrested at the catapult.

/controls/gear/catapult-launch-cmd

Should be set to 1.0 when the aircraft should be launched from tha catapult.
2004-11-19 12:33:53 +00:00
ehofman
3c0ab43b43 Mathias Fröhlich:
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
curt
4214cd6c10 Migrate FlightGear code to use "#include SG_GL*" defined in
"#include <simgear/compiler.h>".
2004-11-18 19:53:00 +00:00
curt
225af83b32 This code is written on top of a driver interface only available with linux
(/proc file system) so it doesn't make sense to have other OS's trying to
open these files because they could never exist.
2004-11-18 17:40:03 +00:00
curt
a1265ddc1d - ATC-Inputs.cxx: Fix some portability problems for non-linux operating
systems.  Fix a couple bugs/oversights.

- atc610x.cxx: Much code has moved into the configurable input mapper
  (ATC-Inputs.cxx) and the remaining input massaging code has moved into
  the atcsim.nas module.
2004-11-18 05:04:35 +00:00
curt
7f9566111d Tweak the atcsim command line interface. 2004-11-18 05:01:19 +00:00
curt
11548e9e7e Minor white space fix. 2004-11-18 05:00:44 +00:00
curt
93faf0afc3 Add a local copy of the nasal documentation. 2004-11-17 02:54:04 +00:00
curt
d66c4c1d82 Get rid of a stray character that must have introduced itself with my random
keyboard fumbling.
2004-11-16 19:48:42 +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
curt
2eeddb8c9f Begin work on revamping the ATC hardware interface so it is infinitely more
configurable.
2004-11-16 19:47:11 +00:00
ehofman
9a8eaae03d commit some pending updates from Vivian 2004-11-16 09:33:21 +00:00
andy
d43d10046b Melchior caught a missing return value that is now an error on newer gcc versions 2004-11-15 18:15:33 +00:00
ehofman
2c72f13163 Roy Vegard Ovesen:
We have decided that hardcoded initialization of instruments and systems is
bad. So we remove them.

Hardcoded initialization is bad because it can't be overridden from config
files or from the command line. We prefer to do it through config files that
should be, eventually, aircraft specific (*-set.xml), not global
(preferences.xml).
2004-11-13 15:00:00 +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
david
42322949fa Reverted last changes, because they caused needle flips near 0. 2004-11-10 20:01:28 +00:00
ehofman
5733464305 Melchior FRANZ:
The caption should already be set when the window is opened. This is
important for some window managers. (KDE's kwin, for example, can store
special settings for certain windows, such as "no border" and "always
on top". KDE uses the window title to determine if a special rule is
to be applied. KDE will be made more tolerant, too.)
2004-11-08 17:41:30 +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
3420e23833 MSVC fix. 2004-11-07 14:23:48 +00:00
david
2f13bafff5 Use angular momentum so that the compass can overshoot and oscillate
before settling.
2004-11-06 16:23:18 +00:00
david
079bc3196e Fixed typo that prevented DME groundspeed display. 2004-11-06 16:22:17 +00:00
david
0f2aad8320 Minor code clean-up. 2004-11-06 16:21:41 +00:00
david
b0c1fb7755 Added acceleration error to compass (most obvious during heavy braking
on the ground) -- this is based on some wild guesses, but it seems
reasonable for now.

The next step will be to give the compass some angular momentum so
that it does not snap instantly to a heading, and so that it can
overshoot a heading and oscillate.
2004-11-05 00:18:58 +00:00
david
04842a0f5b Add errors for pitch, based on a modified equation contributed by
Chris Metzler.
2004-11-04 02:24:46 +00:00
david
956823b161 Begin a rewrite of the magnetic compass code. So far, only northerly
turning error is supported, and I don't know if this works properly in
the southern hemisphere.
2004-11-03 15:59:49 +00:00
david
63cb4e59b7 Begin a rewrite of the magnetic compass code. So far, only northerly
turning error is supported, and I don't know if this works properly in
the southern hemisphere.
2004-11-03 15:15:32 +00:00
david
889dba8d65 Make FlightGear work with 16bpp:
1. Check that SDL actually initializes successfully and sets up its
   video mode.

2. Do not try to enable stencil in 16bpp.
2004-11-03 04:18:27 +00:00
curt
b82cc40c58 Make separate left/right flap surface positions in the net_fdm.hxx
structure for future use.  Right now they are tied together.
2004-10-29 00:13:32 +00:00
ehofman
e3c89b1d33 gcc fixes. 2004-10-28 11:03:15 +00:00
ehofman
73313ed0e1 Boris Koenig:
After applying the attached patches (based on latest CVS) you should
have a new option available within your version that should also
show up using fgfs --help, the syntax is:

    fgfs --min-status={level} --show-aircraft

whereas "level" can be anything between

    "alpha","beta","early-production" and "production"

Of course running something like

    fgfs --min-status=alpha --show-aircraft

should not return any aircraft right now, as none of the
current aircraft definition files in your base-package is using the
required

    <status></status>

tag - but you can easily give it a try by adding something like

    <status>alpha</status>

The tag should be placed as a sub-tag within <sim> - so directly behind
the <description> tag would be just fine and straight-forward.
2004-10-28 09:37: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
2a94cedeba Fix some warnings. 2004-10-26 12:09:31 +00:00
ehofman
ba7fd47740 Roy Vegard Ovesen:
I've made an encoder and a transponder. The transponder gets C-Mode altitude
information from the encoder. These two might not be very usefull right now,
but I think they might come in handy when the ATC network gets going.
2004-10-26 12:06:45 +00:00
ehofman
5071415bd1 Melchior FRANZ:
input.cxx allocates memory for js->getNumAxes() axes and for jsCaps.wNumButtons
or MAX_JOYSTICK_BUTTONS buttons per joystick. But it doesn't check if some
xml config defines bindings for more axes/buttons, in which case it writes
to unallocated memory and causes crashes. This is a real world example:
sidewinder-force-feed-pro.xml defines 7 axes, but only newer versions of
this js do actually have that many. Older ones (-> gameport) don't. The patch
drops unused and unusable bindings.
2004-10-24 14:45:52 +00:00
ehofman
0ab2a40c2a Roy Vegard Ovesen:
I've added two new debug log types for the instrumentation and systems. They
used to use the autopilot debug log, because I couldn't figure out how to
make new log types. Well, now I have figured it out.  ;-)
2004-10-24 11:05:14 +00:00
ehofman
5192c5bc7d Add loadxml/savexml commands and textbox gui dialog. 2004-10-24 09:26:00 +00:00
ehofman
ab4f7b4c60 Add commands to load and save property (sub)trees from or to an XML file. 2004-10-24 09:13:17 +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
a938b5b0df Boris Koenig:
This will modify menubar.cxx/hxx so that it exports the
entire menubar (from menubar.xml) to the property tree, so that it can
now be changed dynamically  using Nasal's setprop() instruction and
afterwards running a newly added fgcommand to update the menubar
based on those changes using the appropriate menubar path within
the property tree.

By default the menubar from menubar.xml will be stored within:

    /sim/menubar/default


Erik:

I have moved the loading of menubar.xml into preferences.xml and
made sure that the menubar is destroyed every time a new menubar
is created.
2004-10-22 09:26:51 +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
3d3922cd46 Accelerations should be added to the velocity, not multiplied 2004-10-20 14:27:29 +00:00
ehofman
133a7d4271 Use the right conversion factor and multiply the accelrations by dt. 2004-10-20 09:47:37 +00:00
ehofman
dfb822e461 Directly updating the right properties doesn't work when not uing --fdm=null, create a separate branch instead. 2004-10-20 09:21:08 +00:00
ehofman
96e24a3e8d Melchior:
Don't overwrite user settings from config files.

fgfs had in any case set bump-mapping to false, no matter if this
node did already exist (because it was defined in a config file).
2004-10-20 08:18:29 +00:00
ehofman
dbbad3cdf2 Frederic:
compilation without ENABLE_SP_FMDS defined gave me a lot of link errors. It appeared that symbol used by ADA was still in use in the HUD.

There is also a typo from Curt in instrument_mgr.cxx where he #include "kr_87.cxx" instead of "kr_87.hxx"
2004-10-20 08:15:55 +00:00
ehofman
e2ce033a8c MSVC fix. 2004-10-20 08:12:55 +00:00