1
0
Fork 0
Commit graph

467 commits

Author SHA1 Message Date
ehofman
d3865a9bf9 Check for the precense of truncf rather than hard-wire it in 2004-01-27 09:31:27 +00:00
ehofman
8c129e8470 Make it possible to show the DME in the HUD 2004-01-26 20:24:29 +00:00
ehofman
4fb5e61162 MSVC fixes 2004-01-26 20:06:03 +00:00
ehofman
64cad6a288 Fixes to the kr_87 radio 2004-01-24 10:05:54 +00:00
ehofman
74d163b51b Rather define our own truncf implementation for BSD alikes 2004-01-23 18:27:55 +00:00
ehofman
44108678f7 BSD doesn't have truncf(), it does have floorf() however 2004-01-23 18:05:05 +00:00
ehofman
02cf3373d5 Use fgGetBool to assign a boolean variable 2004-01-23 09:46:56 +00:00
ehofman
6ba351cfc6 Make it possible to truncate the result of a number-value text chunk calculation rather than rounding it by specifying <truncate>true</truncate> inside the chunk. 2004-01-22 18:42:42 +00:00
ehofman
8e5a884428 Add support for an offset for number-value typed text chunks 2004-01-13 18:28:46 +00:00
curt
25fddbf476 Add the current true heading to the tuned nav station into the property tree. 2003-12-02 15:56:56 +00:00
curt
d3181fb437 Andy Ross:
A set of changes to impliment Nasal support in FlightGear.  The nasal
interpreter is now part of SimGear.
2003-11-25 21:08:36 +00:00
ehofman
e322c70f52 Depreciate NetworkOLK. A big thanks goes to Oliver Delise for implementing it in the first place. 2003-11-13 14:42:47 +00:00
ehofman
980012e168 Move FGEventMgr and FGSubsystemMgr over to SimGear, add SGEventMgr to FlightGear's globals structre and some small code cleanups 2003-09-24 17:20:55 +00:00
ehofman
a33ad90ed7 Convert fgLIGHT to FGLight and make it FGSubsystem compatible. Let the subsystem manager handle it and let FGLight::update() handle the repositioning of the sun and the moon. 2003-09-20 09:38:32 +00:00
ehofman
0f6e4e1c74 Don't just disable depth buffer writes but instead disable the depth test all together 2003-09-16 16:27:01 +00:00
ehofman
174852f01e Try to prevent z-buffer problems for video cards with a 16-bit depth buffer 2003-09-16 14:31:14 +00:00
ehofman
44fda9805b Enable back face culling for cockpit instruments, disable depth buffer writes for 2d instruments but enable depth buffer writes for the magnetic compass. Does anyone care to create a 3d magnetic compass? 2003-09-16 10:02:32 +00:00
ehofman
830ce9108c Disable depth buffer writes for 2D insturments. This should prevent z-buffer fighting 2003-08-16 11:35:04 +00:00
curt
0179cab894 Norman Vine:
Attached patch gets rid of all mention of GLUT from the cockpit directory.
2003-08-12 15:57:17 +00:00
curt
bcb10efa50 Remove several unneeded glut dependencies. Note, this doesn't signal an
immediate end to glut, only that I'm going through and cleaning up (and
taking inventory of the actual glut dependencies in case I want to investigate
SDL.)
2003-08-11 21:50:22 +00:00
curt
d805b8166b Fix several mispellings of servicable->serviceable. 2003-07-30 00:43:25 +00:00
ehofman
f2a2b21661 Small patch to expose the localizer property (e.g., true for ILS localizer) 2003-07-18 08:22:54 +00:00
ehofman
3179cb441a Make it possible to either select the 2d or the 3d HUD 2003-07-14 13:57:11 +00:00
curt
85de2452a3 A couple fixes so the nav/ils heading hold will work again. 2003-07-07 21:19:46 +00:00
david
ba8b2bfca3 Rename some existing variables/methods in the navcomm module for
clarity:

  nav_radial => nav_target_radial (same as selected, except for a LOC)
  nav_heading => nav_reciprocal_radial
  nav_magvar => nav_twist (it's not always the same as magvar)
  nav_heading_needle_deflection => nav_cdi_deflection
  nav_gs_needle_deflection => nav_gs_deflection

Added nav_radial back in, but now it shows the current radial from the
VOR, as one would expect.  This value also appears in the
/radios/nav[*]/radials/actual-deg property.
2003-07-04 19:13:03 +00:00
david
fa4d245555 Change a spelling. 2003-07-03 17:13:03 +00:00
david
9eef30ff6e Fix the property /radios/nav[*]/radials/actual-deg to show the radial
that the aircraft is on.
2003-07-03 17:10:32 +00:00
ehofman
a1968ecb95 Jim Wilson:
This patch exposes the nav_id--Navaid (VOR/ILS) IDs--in the property tree for use in EFIS displays.  Both the string and individual integer (char) values are published.


Erik Hofman:
I have converted all sprintf() functions in navcom.cxx into snprintf() for some extra securety.
2003-07-03 08:51:19 +00:00
curt
3c7bdc31d9 Cosmetic changes for new code moved into simgear to make the naming scheme
better follow simgear conventions.
2003-05-13 03:18:42 +00:00
curt
56db994994 Moved src/Model/loader.[ch]xx and src/Model/model.[ch]xx to
simgear/scene/model/
2003-05-09 20:40:59 +00:00
curt
51c04e9e4c - Added "SG" prefix to sound classes that recently moved to SimGear.
- Cleaned up some minor compiler warnings.
- Moved src/Model/placement.[ch]xx over into simgear/scene/model/
2003-05-09 19:39:48 +00:00
ehofman
5ecfcca7e4 Extract the sound code from FlightGear and move it to SimGear 2003-05-09 18:44:33 +00:00
curt
2119db35c3 This is step "1" of probably "many" in the process of separating out the
scene management code and organizing it within simgear.  My strategy is
to identify the code I want to move, and break it's direct flightgear
dependencies.  Then it will be free to move over into the simgear package.

- Moved some property specific code into simgear/props/
- Split out the condition code from fgfs/src/Main/fg_props and put it
  in it's own source file in simgear/props/
- Created a scene subdirectory for scenery, model, and material property
  related code.
- Moved location.[ch]xx into simgear/scene/model/
- The location and condition code had dependencies on flightgear's global
  state (all the globals-> stuff, the flightgear property tree, etc.)  SimGear
  code can't depend on it so that data has to be passed as parameters to the
  functions/methods/constructors.
- This need to pass data as function parameters had a dramatic cascading
  effect throughout the FlightGear code.
2003-05-06 23:46:24 +00:00
ehofman
d53b612e2a Move the texture loader to SimGear 2003-04-09 20:28:42 +00:00
curt
67ad32267f Sorry, left in some debugging statements, now removed. 2003-03-31 01:35:26 +00:00
curt
5df9811576 I found 3 problems with the GS modeling in flightgear (all my fault originally
I believe.) :-)

- The height of the navaid was not being properly converted to meters
  before being used in our internal calculations.  This caused the GS
  to be placed too high.

- I was using the wrong trig function to calculate the current approach
  angle of the aircraft.  The distance to the GS source is the euclidean
  point to point distance and represents the hypotenuse (not the ground
  distance) so I need to use asin() rather than atan() to calculate the
  angle.

- I was calculating distance directly to the GS source, rather than
  taking into consideration that the GS transmitter projects a plane,
  so I need to take the distance to the line where that plane intersectso
  the ground.  Previously, the way I modeled my distance calculation, the
  GS transmitter effectively formed a 3 degree cone from the source.  The GS
  transmitter is usually placed a 100 meters or so off the runway edge so
  the cone model could never bring you in to the touch down point precisely.

With these changes, the GS will bring you in precisely to the touchdown
point as defined in the default.ils.gz file (it wouldn't before.)  The only
issue that remains is that it will bring you in to the elevation defined
in the ILS database, which doesn't necessarily match the DEM/SRTM terrain
at that point.  Still on average, this will be a big improvement until we
can do a better job of getting the runway end elevations nailed correctly.
2003-03-31 01:29:23 +00:00
ehofman
729a3b9af7 Cache some nodes 2003-03-30 16:49:48 +00:00
ehofman
1f8da4224c Change the log level of somme messages which can harldy be called allerts 2003-03-30 13:30:25 +00:00
ehofman
cf7839a67b Second update in attempt to create an aircraft selection dialog
New panels are loaded now
  New 3D model gets loaded
  Reinitialize more subsystems
  Add reinit() to FGFX, sound gets reinitialized

  Still a lot needs to be done though.
2003-03-30 12:49:05 +00:00
ehofman
4b62426109 Move current_panel to globals 2003-03-30 12:46:08 +00:00
curt
fcf6021f76 Add a property which specifies if the current nav station has a glideslope. 2003-03-29 03:19:03 +00:00
curt
49cace7a21 Fixed intermittant marker beacon audio. 2003-03-29 03:18:17 +00:00
ehofman
ef37b45dc7 Frederic Bouvier's assorted set of MSVC fixes 2003-03-23 09:59:46 +00:00
curt
3ade4d02e6 Removed SG_USING_STD(for_each) to make MSVC happy(er). :-) 2003-03-21 21:09:21 +00:00
curt
4184882757 Add missing #include <algorithm> which provides a prototype for for_each() 2003-03-21 19:41:04 +00:00
ehofman
4c55a5aeb4 Andy wrote:
This is just a port of an old 3D HUD patch to the new view code.
This pans the HUD with the view, by pasting it onto a quad fixed in front of the viewer.  It also fixes the awful, arbitrary scaling problems the HUD code has.  The old HUD only looks right when viewed at 1024x768 and 55 degree FOV.  This works the scale out magically so that it looks right in all views.  It also redefines the "<compression-factor>" tag in the ladder to (1) mean compression instead of expansion and (2) have non-psychopathic units (now "1" means 1 degree per degree).  Fix this in your existing HUD ladder files before reporting bugs.  It's definitely a cosmetic win -- the velocity vector points at the right thing and the horizon lines up properly.

Norman wrote:

I have created a modified version of Andy's patch that implements the 3D HUD as the 'normal' and the 2D HUD as the 'minimal' HUD.   < i > and < shift I > keys
2003-03-21 15:02:23 +00:00
ehofman
df2ce45ab7 Change cout and cerr in SG_LOG() where appropriate, otherwise comment it out 2003-03-20 10:43:02 +00:00
david
191bb21888 Major change:
The "switch" layer type now takes any number of child layers, and will
use the first child that has a condition that evaluates to 'true' (no
condition is automatically true).  Previously, it could take only two
children, controlled by a boolean property.
2003-03-09 03:34:29 +00:00
david
45f3eb7f99 Patch from Erik Hofman:
I've updated the instrument modulator code to allow tricks like the one
described by Andy. It is now possible to define <min>, <max> and
<modulator> in one layer and if <min> and/or <max> ore within the range
of the <modulator> tag, their value will be honoured.

So, if you define

  <layer>
   <min>0</min>
   <max>50</max>
   <modulator>100</modulator>
  </layer>

The value will stay at 50, until the modulator forces it back to 0.
2003-03-02 14:19:24 +00:00
david
4c93c8a070 Temporarily disabled ILS range tweaking, until we come up with a
better scheme.

While it's true that the actual ILS indications are unreliable when
far off the approach path, the ILS is not out of range -- you can
still ident it (an essential part of any approach procedure), and the
indicator will usually be doing something, however bizarre.  The
current scheme did not allow the user to ident the ILS until
practically on the approach path.
2003-02-11 20:05:18 +00:00
david
41b04ba02b Make sure that we have a VOR or VORTAC, and not just a DME or TACAN. 2003-02-06 16:18:17 +00:00
david
fbfb499d49 The switch position was screwed up -- 2 means "hold last frequency",
not "off".
2003-02-06 16:17:47 +00:00
curt
371b5314a8 Updates to use new FGILSList api (updated to better match NavList api) 2003-02-03 20:04:56 +00:00
david
9841edf429 Added a README for the src/Cockpit/ directory. 2003-01-29 15:34:31 +00:00
david
57da4bf02d Removed the old FGSteam module from FlightGear. 2003-01-29 15:30:29 +00:00
david
c165466a07 Use new magnetic compass property. 2003-01-26 15:56:30 +00:00
curt
8cc7b283d5 Refactored some of the navlist code and removed the built in "fail to find"
if the station is too far away.  Instead, simply return the closest station.
All the code that searches navaids does it's own range checking anyway.
This will make the navlist query functions a bit more useful for other
types of functionality where you may need to lookup a station without
consideration of range (i.e. presetting your position relative to a navaid.)
2003-01-25 20:45:39 +00:00
curt
29a3525869 Add a "signed" distance to the GS transmitter. When you are in the approach
hemisphere the distance is positive, if you are in the departure hemisphere
the distance is negature.  (Possible use for graphing approach distance
vs. glide slope or cdi.)
2003-01-22 01:24:32 +00:00
curt
9f6cd30b34 Updates to the net_gui code that can spit out updated flight information
to the network which a gui might be interested in.
2003-01-16 20:57:28 +00:00
david
71f08e795d Patches from Erik Hofman for SGI compatibility:
Some more cmall changes to the SimGear header files and removed the
SG_HAVE_NATIVE_SGI_COMPILERS dependancies from FlightGear.

I've added a seperate JSBSim patch for the JSBSim source tree.
2002-12-31 18:26:02 +00:00
david
52c564b5b8 Patch from Norm Vine to remove unnecessary include-file dependencies. 2002-12-31 03:13:17 +00:00
david
d31e0e7071 Allow panel mouse bindings to use mod-up.
Ensure that if a condition for a panel mouse binding fails, other
bindings for the same area will have a chance to run.

Add a repeatable flag for panel mouse bindings (defaults to true).
2002-12-28 19:05:45 +00:00
curt
6225936ead Various tweaks. 2002-12-21 05:01:51 +00:00
curt
44be7da053 Added support for an audio panel. 2002-12-16 06:09:05 +00:00
curt
2b74a7c3d6 Additional failure modeling.
Support parking brake in external fdm.
2002-12-16 01:13:39 +00:00
curt
43e48070fe - Some refactoring of the configure.ac script.
- Better Mac OS X support (they put glut.h in GLUT/glut.h) :-(
2002-12-10 20:50:48 +00:00
curt
64028a37ef Andy Ross:
I wrote:
 > I can confirm this.  Layers on the 2D panels (but oddly, only the 2D
 > panels) aren't drawing over the background with the current ATI
 > drivers.

OK, this turns out to be a trivial fix, although I still think it's a
driver bug.  There are two calls to glPolygonOffset in the panel
rendering code (shared by both 2D and 3D panels).  One is called
per-layer, and sets up a layer-specific offset.  The other is called
for drawing the background textures, to lift them off of any
underlying cockpit geometry.

I was using different "factor" values for each, incorrectly.  Patch
attached.  It was affecting only 2D panels because the 3D ones don't
use background images.

Problem is, by my reading of the specification the bug should have had
the effect of pushing the background texture *farther* behind the
instruments, instead of pulling it on top of them.  Either I'm reading
the spec incorrectly or ATI has inverted the sense of the factor
argument.  Dunno, I'll submit a bug report to them and see what
happens.
2002-12-01 22:38:38 +00:00
david
8eb735d149 I wrote:
> Jim Wilson wrote:
 > > How hard would it be to have a property that toggles hotspot
 > > visibility?  It'd be nice to be able to turn it on and have yellow
 > > rectangles show up on the hotspots...
 >
 > That's not a bad idea.

It's actually an astoundingly good idea, and implementable over lunch
to boot. :)

Try the attached patch, which predicates the boxes on the
/sim/panel-hotspots property.  I mapped a toggle event on this to a
spare joystick button, and had fun. :)

[dpm: bound to Ctrl-C]
2002-11-17 00:04:57 +00:00
david
a53ccae248 Make sure led_font isn't used unless it's initialized. 2002-11-16 22:13:49 +00:00
david
de0f20aa22 Reduce POFF_UNITS from 40 to 4, following Andy Ross's suggestion (to
avoid having the 2D instruments obscure 3D objects in front of them):

It's related to depth buffer precision.  On my Geforce cards (2MX and
3), it never happens with the 24 bit depth buffer you get by default
at 32bpp.  At 16bpp, it picks a slimmer depth buffer (probably 16 bit)
and the texture layers bleed through.

The code is using a pretty big argument to glPolygonOffset, and I've
never investigated how small it can be.  If someone has a little time
the next time they see this issue, try changing the value of
POFF_UNITS at the top of Cockpit/panel.cxx.  Decrease it until the
textures *just* start to interfere with each other, and post the value
that works for you.
2002-11-16 22:08:22 +00:00
curt
72017fc671 Andy Ross:
The biggest and coolest patch adds mouse sensitivity to the 3D
cockpits, so we can finally work the radios.  This ended up requiring
significant modifications outside of the 3D cockpit code.  Stuff folks
will want to look at:

+ The list of all "3D" cockpits is stored statically in the
   panelnode.cxx file.  This is clumsy, and won't migrate well to a
   multiple-aircraft feature.  Really, there should be a per-model list
   of 3D panels, but I couldn't find a clean place to put this.  The
   only handle you get back after parsing a model is a generic ssg
   node, to which I obviously can't add panel-specific methods.

+ The aircraft model is parsed *very* early in the initialization
   order.  Earlier, in fact, than the static list of allowable command
   bindings is built in fgInitCommands().  This is bad, as it means
   that mouse bindings on the instruments can't work yet.  I moved the
   call to fgInitCommands, but someone should look carefully to see
   that I picked the right place.  There's a lot of initialization
   code, and I got a little lost in there... :)

+ I added yet another "update" hook to the fgRenderFrame routine to
   hook the updates for the 3D panels.  This is only required for
   "mouse press delay", and it's a fairly clumsy mechanism based on
   frame rate instead of real time.  There appears to be delay handling
   already in place in the Input stuff, and there's a discussion going
   on about different mouse behavior right now.  Maybe this is a good
   time to unify these two (now three) approaches?
2002-10-29 19:44:03 +00:00
curt
9c561ab860 Add a pre/post draw call back to strobe lights so we can make them bigger
so they will stand out from everything else.
2002-10-18 18:43:50 +00:00
curt
f38c88b762 Fix an init order bug and do some minor cleanups. 2002-10-16 02:02:39 +00:00
david
ab27c591b5 Removed print statements accidentally committed. 2002-10-01 23:35:33 +00:00
david
42dfe6256f Corrected so that deflections are reversed on ILS backcourse. 2002-10-01 23:28:17 +00:00
curt
c7df5f3639 Panel night lighting acts as if lights are always turned on. We don't
really see anything different in the day, but as day turns to night the
panel smoothly darkens and the lighting component becomes visible.
Lights are wired to electrical system so if you kill power, you lose the
lights.
2002-09-28 03:57:37 +00:00
curt
3fdcbbd6ce Code clean ups. 2002-09-26 17:25:19 +00:00
curt
cd9c38e0b4 Connect to the electrical system. 2002-09-26 17:24:11 +00:00
curt
2a73201ca8 More code shuffling. 2002-09-26 16:19:06 +00:00
curt
eaf4954441 Shuffling/reorganizing code. 2002-09-26 15:34:00 +00:00
curt
2a19fc2f53 Work on wiring the dme into the electrical model. 2002-09-26 14:13:42 +00:00
curt
4a28902197 Begin interfacing the navcom's to the electrical model. 2002-09-26 04:47:29 +00:00
curt
02d1d81348 Fixed a compiler warning. 2002-09-25 22:05:14 +00:00
curt
f6607cac90 Removed some depricated code snippets. 2002-09-23 18:52:21 +00:00
curt
5133b9467b Removed some left over debugging output. 2002-09-23 18:49:12 +00:00
curt
29e72b0b90 Various tweaks and fixes to navcom radios.
Oops, taking the address of a temporary in main.cxx: 3dcloud rendering.
2002-09-23 18:44:09 +00:00
curt
53b9eacf74 Stabalize cloud shading. 2002-09-19 02:21:23 +00:00
curt
3d2311d884 Split Nav/Com units out into their own source code file to continue the
process of simplifying radiostack.[ch]xx
2002-09-19 01:11:07 +00:00
curt
430f030cbf Make adf volume and adf on/off seperate properties. 2002-08-29 04:18:55 +00:00
curt
4f00d9a959 Tidy up the autoconf/automake configuration a bit.
- Removed some old cruft.

- Removed some support for older versions of automake which technically was
  correct, but caused the newer automakes to squawk warnings during an
  initial sanity check (which isn't done very intelligently.)

  NOTE: this fix is technically not correct for older version of automake.
  These older version use the variable "INCLUDES" internally and could have
  them already set to an important value.  That is why we were appending
  our values to them.  However, newer versions of automake don't set this
  value themselves so it is an error to append to a non-existant variable.
  We seem to "get away" with overwriting the value on older versions of
  automake, but if you have problems, consider upgrading to at least
  automake-1.5.
2002-08-25 19:40:04 +00:00
curt
9238050068 Add support for flipping the instrument panel vertically on screen (if
we want to do a full screen panel on a device that is mounted upside
down.)
2002-08-19 02:07:39 +00:00
curt
f4e1298a1a Added formatted time to property tree for use by 'virtual' instruments. 2002-07-30 02:56:42 +00:00
david
edaac686a2 Patch from Melchior Franx to restore fog on tdfx cards like the Voodoo3. 2002-07-27 22:31:40 +00:00
curt
493fcadacd Save state before drawing '3d' panel, and then restore it after. 2002-07-22 21:09:42 +00:00
david
def3c68ffa Patch from Cameron Moore:
* Rearranged member initializers to shut gcc -Wall up
2002-07-18 22:31:53 +00:00
david
ebb180f094 Patch from Cameron Moore:
* Fixed uninitialized values
2002-07-18 22:31:36 +00:00
david
5aee96c481 Change FGSteam into a proper subsystem rather than a collection of
static methods, and remove outdated dependency in panel_io.cxx.
2002-07-07 15:45:56 +00:00
david
bf58dbd3c9 Patch from Julian Foad:
- tidies up the update-time-step handling (making it a simple "dt");
- makes the altimeter get a proper pressure, and the (unused) vacuum
  calculation get a proper RPM (*);
- replaces property name look-ups with static pointers to property nodes.

Notes from DPM:

- the static pointers are a very bad idea, but they're only temporary;
  I plan to make FGSteam into a proper subsystem soon, and then they
  can be member variables
- I fixed the patch to get the current static pressure from the
  /environment/pressure-inhg property, so that the altimeter interacts
  properly with FGEnvironment
2002-07-07 13:29:52 +00:00
david
b2d8574b75 Remove a kludge that was introduced to work around the #defined "NONE". 2002-07-06 17:50:52 +00:00
david
30d239eeda Change identifiers to their new names to match hud.hxx. 2002-07-06 17:50:38 +00:00
david
fb40950e78 Prefix "HUD_" (or "HUD_FONT_" in two cases) to #defined identifiers.
Remove some unused #defines (not mentioned anywhere, even in
comments).
2002-07-06 17:50:16 +00:00
curt
5f37f2eaa5 Initial revision of a Bendix/King KT 70 transponder. 2002-07-04 21:37:34 +00:00
curt
ac61b8323e Fixed up a couple loose ends. 2002-07-04 21:37:06 +00:00
curt
2fec1506d3 A bunch of reorg and clean up of the KR 87 (adf) code including some
property renaming with corresponding changes to instruments in the base
package.
2002-07-03 23:35:21 +00:00
curt
24d14dd421 Updated adf property names. 2002-07-03 21:52:13 +00:00
curt
f6e8060879 A couple ADF needle direction tweaks. 2002-07-03 05:15:04 +00:00
curt
b3be31c5ab Add support for KR 87 annunciators. 2002-07-03 04:48:44 +00:00
david
e4d014a959 Commented out a cout statement. 2002-07-03 04:04:00 +00:00
curt
1bbc82a438 Default to ADF (rather than ANT) mode and start with the ADF turned on.
Oops, left in a debugging statement.
2002-07-02 22:39:04 +00:00
curt
aef1876858 - Oops, some name simplification led to overlapping variable names which caused
the adf needle to not point correctly, fixed.
- Make the code slightly smarter so ADF needle never takes the long way around
  to it's destination.
2002-07-02 22:35:15 +00:00
curt
fa6ad91fde Working on implimenting the timer features of the King KR 87 ADF (as well
as some of the other subtleties.)
2002-06-30 22:44:38 +00:00
david
b53cd9c59f 3D panel support from Andy Ross:
+ The panel(s) are now an first-class SSG node inside the aircraft
  scene graph.  There's a little code added to model.cxx to handle the
  parsing, but most of the changes are inside the new FGPanelNode
  class (Model/panelnode.[ch]xx).

+ The old FGPanel source changed a lot, but mostly cosmetically.  The
  virtual-cockpit code moved out into FGPanelNode, and the core
  rendering has been abstracted into a draw() method that doesn't try
  to set any OpenGL state.  I also replaced the old inter-layer offset
  code with glPolygonOffset, as calculating the right Z values is hard
  across the funky modelview matrix I need to use.  The older virtual
  panel code got away with it by disabling depth test, thus the "panel
  draws on top of yoke" bug.  PolygonOffset is really the appropriate
  solution for this sort of task anyway.

+ The /sim/virtual-cockpit property is no more.  The 2D panels are
  still specified in the -set.xml file, but 3D panels are part of the
  model file.

+ You can have as many 3D panels as you like.


Problems:

+ The mouse support isn't ready yet, so the 3D panels still aren't
  interactive.  Soon to come.

+ Being part of the same scene graph as the model, the 3D panels now
  "jitter" in exactly the same way.  While this makes the jitter of
  the attitude gyro less noticeable, it's still *very* noticeable and
  annoying.  I looked hard for this, and am at this point convinced
  that the problem is with the two orientation computations.  We have
  one in FGLocation that is used by the model code, and one in
  FGViewer that is used at the top of the scene graph.  My suspicion
  is that they don't agree exactly, so the final orientation matrix is
  the right answer plus the difference.  I did rule out the FDMs
  though.  None of them show more than about 0.0001 degree of
  orientation change between frames for a stopped aircraft.  That's
  within an order of magnitude of what you'd expect for the
  orientation change due to the rotation of the earth (which we don't
  model -- I cite it only as evidence of how small this is); far, far
  less than one pixel on the screen.

[and later]

OK, this is fixed by the attached panel.cxx file.  What's happened is
that the winding order for the text layer's polygons is wrong, so I
reverse it before drawing.  That's largely a hatchet job to make
things work for now, though.  We should figure out why the winding
order is wrong for only text layers and fix it.  I checked the plib
sources -- they're definitely doing things CCW, as is all the rest of
the panel code.

Odd.  I'm also not sure why the 2D panel doesn't care (it works in
both winding orders).  But this will allow you to check in working
code, anyway.  There's a big comment to this effect in there.
2002-06-28 14:17:40 +00:00
curt
a6c192911d Initialize a value so we don't see non-deterministic behavior. 2002-06-27 20:48:39 +00:00
curt
a7e237abd6 A little prepratory code reorganization before modeling the King KR 87
Silver Crown Digital ADF.
2002-06-16 00:05:07 +00:00
david
4acb59a020 Renamed property /steam/vertical-speed-fpm to /steam/vertical-speed-fps. 2002-06-05 22:39:00 +00:00
david
34e2e52158 Patch from Georg Kaiser. 2002-06-05 21:43:44 +00:00
curt
fcd6b28e0f Bernie Bright:
I've defined snprintf as _snprintf in compiler.h for MSVC and MINGW
targets and removed duplicate definitions from FG sources.
2002-05-17 16:41:27 +00:00
david
abdb5abb6a Fixed handling of delta time (just a kludge for now): VSI behaves
reasonably again, and DG doesn't drift too fast any more.
2002-05-14 14:21:27 +00:00
curt
47825dcbae Moved "scenery" from being declaried in scenery.cxx to being declared
in globals.hxx.
2002-05-14 05:22:52 +00:00
david
5a849b66e8 Major overhaul:
- changed FGSubsystem::update(int) to
  FGSubsystem::update(delta_time_sec); the argument is now delta time
  in seconds rather than milliseconds

- added FGSubsystem::suspend(), FGSubsystem::suspend(bool),
  FGSubsystem::resume(), and FGSubsystem::is_suspended(), all with
  default implementations; is_suspended takes account of the master
  freeze as well as the subsystem's individual suspended state

- the FDMs now use the delta time argument the same as the rest of
  FlightGear; formerly, main.cxx made a special case and passed a
  multiloop argument

- FDMs now calculate multiloop internally instead of relying on
  main.cxx

There are probably some problems -- I've done basic testing with the
major FDMs and subsystems, but we'll probably need a few weeks to
sniff out bugs.
2002-05-11 16:28:50 +00:00
david
f3eafe1007 Property patches from Frederic Bouvier:
The FlightGear patch is to take account the change in the getChildren
function that now returns a vector<SGPropertyNode_ptr>. If the
removeChild functionnality is to be added in FlightGear, all those
SGPropertyNode * floating around should be changed to
SGPropertyNode_ptr.
2002-05-11 00:59:26 +00:00
david
56473dc28d Mac OS X fixes and MSVC warning fixes from Jonathan Polley. 2002-05-10 23:35:06 +00:00
david
1e73f62481 Patch from Melchior Franz:
the states of all the volume buttons are requested in saveInitialState before
they are first set
2002-04-25 19:26:47 +00:00
curt
cf146a7d1b Fix a couple "make dist" problems that crept in since the last release.
Regengerate msvc project files.
2002-04-21 05:51:37 +00:00
curt
b36f19b871 Detect and recover from a math overflow that can possibly prevent panel text
from updating if the instrument panel is not drawn for more then 35.7
minutes.
2002-04-19 14:05:58 +00:00
curt
97cc733ac8 Tracked down a potential segfault when trying to audibly ident a vor station.
This led to an investigation into why the ident playing didn't work anymore.
Recent changes in the sound manager broke some assumptions the radiostack
code was making.  These patches should hopefully fix all that back up.
Erik, please review these changes to double check I didn't do more damage
than good. :-)
2002-04-18 21:43:00 +00:00
david
03c431aa56 Patch from Norman Vine to save some property lookups. 2002-04-12 12:44:58 +00:00
curt
ab0964384e Bernie Bright:
Here are the Boost-less FGEventMgr updates I promised.

Removed Boost dependencies from FGEventMgr.
Removed Boost configure check.
fgMethodCallback now handles const member functions.

I've successfully tested these changes with gcc and msvc.
2002-04-11 16:25:12 +00:00
david
396674ce2e Patch from Martin Dressler:
This patch moves built-in Class (for now only mag-ribbon) into special
directory as you have written it in TODO: in comments of this class in
panel_io.cxx.  IMHO it is good idea.  I want to play with built-in
classes and OpenGC and this will be useful.
2002-04-07 21:13:56 +00:00
curt
41a4d0b351 Here is the 'boostified' event manager plus relevant changes to
radiostack.cxx, fg_init.cxx and main.cxx.  If these changes are accepted
then you can remove Time/event.[ch]xx and Include/fg_callback.hxx from
the repository.
2002-04-05 20:03:49 +00:00
david
57bccb1827 Patch from Melchior Franz:
radiostack.cxx:703 says
      bool light_on = ( outer_blink || middle_blink || inner_blink );
but none of the flags has ever been initialized when this line is first
executed.
2002-03-30 12:49:17 +00:00
david
36e012c400 Patch from Norm Vine:
patch to enpower HUD to  display elevator trimval
2002-03-27 20:27:52 +00:00
david
ec6a0b2810 Fixed a bug report from Frederic Bouvier:
as a follow-up of my previous message, I found that in panel.cxx, function
const char *FGTextLayer::Chunk::getValue () const, there is the use of a
member variable _buf that seems to be uninitialized.
2002-03-27 12:59:53 +00:00
curt
0a035c7f36 Oops, in the latest property manager rewrite, a typo crept in on
somewhat of a global scale.  This commit should fix all these up.
2002-03-26 02:38:11 +00:00
david
9709dcb307 First steps towards configurable mouse input. Soon, this new code
(mainly in src/Input/input.cxx) will make src/GUI/mouse.cxx obsolete
and bring the mouse into the same input system as the joystick and
keyboard.  This is just preliminary work allowing, covering mouse
clicks (no motion yet), and it actually crashes on a middle or right
click.

The new mouse support is disabled by default until it become stable;
to try it out, you need to configure --with-new-mouse.
2002-03-23 23:16:13 +00:00
curt
c032f841e2 more ( string == "" ) to ( string.empty() ) conversions. 2002-03-21 05:31:55 +00:00
david
f65f1800c7 Use !strcmp for all property name comparisons. 2002-03-20 22:23:10 +00:00
david
d0d3b2bd7a Use !strcmp for all property string-value comparisons. 2002-03-20 22:15:22 +00:00
curt
e95429572c Converted if ( string == "" ) constructs to if ( string.empty() )
Fixed a warning in soundmgr.cxx.
2002-03-20 19:16:13 +00:00
david
4d4cd16012 Major viewer-code overhaul from Jim Wilson:
Description:

This update includes the new viewer interface as proposed by David M. and
a first pass at cleaning up the viewer/view manager code by Jim W.

Note that I have dropped Main/viewer_lookat.?xx and Main/viewer_rph.?xx and
modified the Makefile.am accordingly.


Detail of work:

Overall:
The code reads a little easier.  There are still some unnecessary bits in
there and I'd like to supplement the comments in the viewer.hxx with a tiny
bit on each interface group and what the groupings mean (similar but briefer
than what you emailed me the other day).  I tried not to mess up the style,
but there is an occasional inconsistency.  In general I wouldn't call it done
(especially since there's no tower yet! :)), but I'd like to get this out
there so others can comment, and test.

In Viewer:
The interface as you suggested has been implemented.  Basically everything
seems to work as it did visually.  There is no difference that I can see in
performance, although some things might be a tiny bit faster.

I've merged the lookat and rph (pilot view) code into the recalc for the
viewer.  There is still some redundancy between the two, but a lot has been
removed.  In some cases I've taken some code that we'd likely want to inline
anyway and left it in there in duplicate.  You'll see that the code for both
looks a little cleaner.  I need to take a closer look at the rotations in
particular.  I've cleaned up a little there, but I suspect more can be done
to streamline this.

The external declaration to the Quat_mat in mouse.cxx has been removed.  IMHO
the quat doesn't serve any intrinsic purpose in mouse.cxx, but I'm not about
to rip it out.  It would seem that there more conventional ways to get
spherical data that are just as fast.  In any case all the viewer was pulling
from the quat matrix was the pitch value so I modified mouse.cxx to output to
our pitchOffset input and that works fine.

I've changed the native values to degrees from radians where appropriate.
This required a conversion from degrees to radians in a couple modules that
access the interface.  Perhaps we should add interface calls that do the
conversion,  e.g. a getHeadingOffset_rad() to go along with the
getHeadingOffset_deg().

On the view_offset (now headingOffset) thing there are two entry points
because of the ability to instantly switch views or to scroll to a new view
angle (by hitting the numeric keys for example).   This leaves an anomaly in
the interface which should be resolved by adding "goal" settings to the
interface, e.g. a setGoalHeadingOffset_deg(), setGoalPitchOffset_deg(), etc.

Other than these two issues, the next step here will be to look at some
further optimizations, and to write support code for a tower view.  That
should be fairly simple at this point.  I was considering creating a
"simulated tower view" or "pedestrian view" that defaulted to a position off
to the right of whereever the plane is at the moment you switch to the tower
view.  This could be a fall back when we don't have an actual tower location
at hand (as would be the case with rural airports).

ViewManager:
Basically all I did here was neaten things up by ripping out excess crap and
made it compatible as is with the new interface.

The result is that viewmanager is now ready to be developed.  The two
preexisting views are still hardcoded into the view manager.  The next step
would be to design configuration xml (eg /sim/view[x]/config/blahblah) that
could be used to set up as many views as we want.  If we want to take the easy
way out, we might want to insist that view[0] be a pilot-view and have
viewmanager check for that.
2002-03-20 17:43:28 +00:00
curt
99fa3a6e79 Various Irix cleanups.
Float/Double clean ups for fg_sound.cxx
2002-03-20 15:57:31 +00:00
david
0cc3bed841 Major property-manager rewrite, using const char * throughout
interface instead of string.  This will result in a lot more
efficiency later, once I add in a simple hash table for caching
lookups, since it will avoid creating a lot of temporary string
objects.  The major considerations for users will be that they cannot
use

  node->getName() == "foo";

any more, and will have to use c_str() when setting a string value
from a C++ string.
2002-03-19 17:12:13 +00:00
david
d0eaafb1e1 Patches from Tony Peden to separate property XML I/O operations into a
separate header file.  This change will help integrate properties into
JSBSim.

Also, I (David Megginson) removed most of the SimGear include
statements from globals.hxx, reducing the amount of recompilation
every time SimGear changes.  This required making minor changes to a
lot of files that were depending on the side-effects of the inclusions
in globals.hxx.
2002-03-16 00:18:38 +00:00
david
753242577f More work on saving and restoring flights. Restoring a flight is not
working in a running FlightGear session because of JSBSim trim-routine
problems, but it does work from the command-line now, i.e.

  fgfs fgfs.sav
2002-03-14 14:25:30 +00:00
david
36876decf3 Autopilot cleanup:
- implement the standard FGSubsystem interface, for consistency
- eliminate current_autopilot and add get/set_autopilot to FGGlobals,
  for consistency
- use private methods rather than static functions for tying
  properties

There should be no change in functionality.
2002-03-13 16:31:21 +00:00
david
6cca1d6a75 Eliminate dependencie on tying variable pointers (in preparation for
property-code simplification).
2002-03-13 15:16:24 +00:00
curt
62ed7592e3 Fixes for Irix compatibility.
Fix several long standing irix compiler warnings.
2002-03-12 20:01:54 +00:00
curt
6b40600e7b Sgi doesn't define the != operator for string != char[] so we need to cast
the char array into a (string) type before doing the comparison.
2002-03-08 23:24:59 +00:00
david
0bdc1b1699 Patch from Andy Ross to hide virtual panel when required:
Oh yeah, I forgot to send that one along.  This one is my bug, I
goofed the precedence in the fgPanelVisible() function in panel.cxx
such that the panel was *always* visible if virtual cockpit was
enabled.  Here's a replacement.  I've modified the style from a single
boolean expression to an if-list, since that's more readable to my
eyes for expressions this big:
2002-03-06 13:51:05 +00:00
curt
519ac21fa8 Fix a visibility condition bug in 3d panel. 2002-03-04 19:59:22 +00:00