I restored the output to cout / cerr
for the options and the warning for the version mismatch.
There is a dummy SG_LOG to allow the windows version to
popup the console.
FG_ENABLE_MULTIPASS_CLOUDS must be defined to enable
the algorithm. I made this because the stencil buffer
must be initialized at the beginning of the program and
OpenGL can fallback to software rendering if it can't
find a visual with stencil buffer. I didn't touch the
configure script, so CXXFLAGS=-DFG_ENABLE_MULTIPASS_CLOUDS
must be set before running ./configure.
If FG_ENABLE_MULTIPASS_CLOUDS is defined, the main render
loop begins by reading the /sim/rendering/multi-pass-clouds
property. It is a boolean property so there are only two
quality levels. false means no multi pass and no use of
the stencil buffer, true means an additionnal pass for
both upper and lower cloud layers.
The algorithms are as follow :
/sim/rendering/multi-pass-clouds=false
1. draw sky dome
2. draw terrain only
3. draw clouds above the viewer
4. draw models except the aircraft
5. draw clouds below the viewer
6. draw the aircraft.
The cloud rendering doesn't update the depth buffer.
This means that models overwrite clouds above the viewer.
This is only noticeable for tall buildings and when
flying very low. Also, drawing low clouds after models
means that they are not blended with models' translucent
surfaces. Large transparent area require alpha test
enabled and AI aircraft canopy are making holes. The
pilot's aircraft being rendered at the end, there is no
problem with canopy or prop disc.
/sim/rendering/multi-pass-clouds=true
1. draw the sky dome
2. draw the terrain only
3. draw all clouds
4. draw models except the aircraft
5. redraw the clouds where the models where drawn ( stencil
test on )
6. draw the aircraft
The assumptions made by this algoritm are that the terrain
is not transparent ( should be true in all cases and
that there are no clouds between the aircraft and the viewer.
Assuming these facts, there should be no blending bugs.
andy [Thu, 1 Apr 2004 23:28:47 +0000 (23:28 +0000)]
I was too agressive in the fg_os port. Glut doesn't support grabbing
the keyboard modifiers outside of a key event handler, so adding the
fgGetKeyModifiers() call to doMouseMotion was broken. The user could
see "phantom" modifier keys.
ehofman [Tue, 30 Mar 2004 09:05:05 +0000 (09:05 +0000)]
Frederic Bouvier:
trying the --show-aircraft option, I noticed that I had
no output. This is because there are still output to
cout or cerr, that are not triggering my console patch
for windows. The patch attached use SG_LOG instead.
A request to hit a key is also added because otherwise,
the console window will disappear as soon as the program
stop.
This problem is minor though given the fact that fgfs.exe
is shipped with fgrun that do show the available aircraft
in a much nicer manner.
andy [Sat, 27 Mar 2004 18:34:04 +0000 (18:34 +0000)]
More work to get the starter behavior right, without breaking David's
work on the pa28 idle and without creating ridiculous side effects
(like being able to fly the aircraft with the starter motor, heh).
This one looks pretty good for now, pending work on the propeller to
get its low speed drag in line with reality.
andy [Sat, 27 Mar 2004 04:07:18 +0000 (04:07 +0000)]
YASim now supports the new fuel.nas fuel management system. It
reads the /consumables tree for input to determine weights, but
places output only in /engines/engine[n]/fuel-consumed-lbs where
it gets picked up by the Nasal code.
curt [Tue, 23 Mar 2004 13:19:40 +0000 (13:19 +0000)]
Jim Wilson:
This is a fix for my earlier "Remove some hardcoded dependencies between fdm,
viewer and acmodel" patch. The problem was discovered when testing the
wrightFlyer.
curt [Mon, 22 Mar 2004 15:00:42 +0000 (15:00 +0000)]
plib-1.8.0 no longer defines the cchar type (which we used because we were
deriving a class and the base class used this type.) Return to using
const char and hope people compiling against earlier versions of plib
have compilers that think typedef const char cchar; char *abc; is equivalent
to const char *abd;
curt [Mon, 22 Mar 2004 02:17:41 +0000 (02:17 +0000)]
Frederic Bouvier:
I made these changes because fltk doesn't recognize path
\\SERVER\SHARE as a normal directory, although plib/ul
function succeed at enumerating the content of such a
path.
I had that problem when I decided to test FG on a loaned
HP xw4100 workstation. I installed it over the network and
the install-source became \\myserver\myshare\. with no
scenery files detected.
ehofman [Sat, 20 Mar 2004 22:42:41 +0000 (22:42 +0000)]
Frederic Bouvier:
The message 'Alert: catching up on tile delete queue'
comes from the fact that 48 tiles are scheduled and
added to the cache at startup before the plane location
is initialized. My proposed patch is to initialize
SGLocation with an invalid position and detect this
fact before scheduling tiles. I prefer to do that
rather than testing for lon and lat being 0,0 because
it is a valid position and someone could want to fly
near Accra.
ehofman [Sat, 20 Mar 2004 22:39:30 +0000 (22:39 +0000)]
Frederic Bouvier:
This patch is for windows only. It hides the console window
until there is a message to print. It only support SG_LOG,
that I think is the right way to display something in FG.
daveluff [Sat, 20 Mar 2004 03:13:29 +0000 (03:13 +0000)]
Delay deletion of AI traffic until after it has had time to release the frequency after its last transmission. This is a bit of a band-aid for more deep-seated problems with the dialog model, but it will solve some problems for now
curt [Fri, 19 Mar 2004 03:23:28 +0000 (03:23 +0000)]
Jim Wilson:
Add FGPredictor class to xmlauto. Add support for horizontal navigation based
on flight track as opposed to heading. Add crosstrack-error support to nav.
Simplify error adjust calculation for horizontal nav (better interception).
Fixed potential divide by zero that was producing nan issues in the xmlauto
code.
curt [Mon, 15 Mar 2004 20:34:38 +0000 (20:34 +0000)]
Frederic Bouvier:
I made some changes to current CVS :
- the window is gently resizable, keeping the buttons' height
unchanged, with a minimun size,
- the current activity ( installation or removal ) is displayed
in the progress bar,
- the progress status is exact. For installation, I am
using the total bytes read vs the file size. I had to hack
untarka somehow and bzip2 and Z methods needs to be implemented.
For removal, I am counting files by in-depth traversal, in the
same way remove_dir is working. This seems very quick and
the overhead is unnoticable.
- the Quit button is the only way to quit the program, and it is
deactivated during work. Otherwise, we can get the window hidden
but the program still running in background.
- cleanup on start options that seemed to be copied from fgrun.
Valid options are now :
--silent
to write fgadmin.prefs and stop immediately
--install-source=<DIR>
--scenery-dest=<DIR>
curt [Mon, 15 Mar 2004 19:23:39 +0000 (19:23 +0000)]
Roy Vegard Ovesen:
I've done som more work on the gps instrument.
- You can now input airport-, nav- or fix-ID to select a waypoint.
- You have to specify either "airport", "nav" or "fix" in the waypoint-type
property (some fixes and navs have identical IDs).
- Formatted the time to waypoint output.
- Cleaned up and changed some propery names (wp-heading -> wp-bearing).
- I've also added a name member to the FGNav class so that the gps instrument
can get the name of the nav.
- Changed the airport name parsing in simple.cxx.
curt [Mon, 15 Mar 2004 19:09:44 +0000 (19:09 +0000)]
Roy Vegard Ovesen:
I've done some changes to xmlauto.cxx.
Only calculate the derivate filtering if derivate time Td is greater than
zero. This means that one can set Td=0.0 in the xml file to completely remove
the derivate action. (Setting Td to zero in the current version would lead to
a division by zero and crash.)
Setting the integrator time Ti to zero doesn't make sense, right! I've
modified so that setting Ti to zero results in the integral action being
completely removed.
curt [Sun, 14 Mar 2004 23:04:32 +0000 (23:04 +0000)]
- Filter the fuel switch position to allow it to slowly transition through
null space without killing the engine (hardware specific problem.)
- NMEA output: I'm slightly confused but it appears that a real GPS outputs
traditional unix line endings on it's gps strings, we were outputing DOS
CR/LF which was causing some confusion. This changes the line ending
convention to match that of a real gps.
- Calculate true ground track and speed for NMEA.
curt [Sun, 14 Mar 2004 23:01:09 +0000 (23:01 +0000)]
Change nav->get_elev() to nav->get_elev_ft() to convey the actual units
explicitely. This value has always been feet, but there were a couple places
in the code that assumed this elevation was meters. The result was that you
could park directly over the top of the Black Forest VOR (112.50) NE of KCOS
and get a dme reading of 2.5 or so. This problem is now resolved.
daveluff [Fri, 12 Mar 2004 15:59:14 +0000 (15:59 +0000)]
Don't clear the user to land following downwind report if there is other traffic on final to land first - instruct the user to follow the other traffic and clear the user to land once the other traffic is clear of the runway instead.
ehofman [Sun, 7 Mar 2004 12:08:46 +0000 (12:08 +0000)]
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.
daveluff [Sat, 6 Mar 2004 14:44:38 +0000 (14:44 +0000)]
Start making the AI traffic robust to not getting a tower pointer from ATC. Eventually this should also lead to being able to generate AI traffic at uncontrolled airports
daveluff [Fri, 5 Mar 2004 16:24:04 +0000 (16:24 +0000)]
Use the airport elevation instead of the actual ground elevation when out of visible range of the user. This should reduce thrashing / pollution of the tile cache.
daveluff [Tue, 2 Mar 2004 10:43:16 +0000 (10:43 +0000)]
Move the mechanics of turning out of the derived classes into AIPlane. The user-visible effect is that AI planes no longer suddenly change direction without turning properly.
daveluff [Tue, 2 Mar 2004 10:37:38 +0000 (10:37 +0000)]
Don't cast string to c_str before passing to functions that take string, and remove an inadvertant push onto the airport_atc_map of data that already exists on it
curt [Sat, 28 Feb 2004 19:52:17 +0000 (19:52 +0000)]
Investigating some wierd behavior where the threaded metar fetcher would
occasionally cause a large number of valid stations to be flagged as invalid.
This *seemed* like a "race condition" type problem because there were some
assumptions in the communication between the main process and the threaded
loader which if they broke down could lead to this problem.
In the process of removing this ambiguity, I restructured the threaded
(and non-threaded) metar fetching code a bit. Some of the top level logic
(which Erik politely left untouched) didn't make nearly as much sense in the
context of a threaded metar loader and could have contributed to some of the
wierdness I was seeing.