andy [Sat, 1 May 2004 00:25:56 +0000 (00:25 +0000)]
Attempt at a fix for the propeller torque problems in the
"slow/windmilling propeller" regime. I'm happy with the foundations
of the solution, but this hasn't been complete tested yet. The
solution behavior seems fine on the planes I tried.
andy [Fri, 30 Apr 2004 19:06:29 +0000 (19:06 +0000)]
Refactoring in preparation to add a turbine engine to YASim. The
PistonEngine class has grown an "Engine" superclass. Some other stuff
moved around too, and I cleaned up some property naming while I was in
there. This hasn't been tested very thorougly, hopefully I didn't
break anything.
andy [Fri, 30 Apr 2004 00:52:11 +0000 (00:52 +0000)]
Changes to get FlightGear (well, the src directory at least) to
configure and compile out-of-the-box on a MinGW target:
Use -lSDL instead of -lglut32 on windows builds when --enable-sdl
is set.
Link against alut.dll in addition to openal32.dll.
Replace BSD bcopy() with ANSI C memmove() in a few places. This is
simpler than trying to abstract it out as a platform dependency in a
header file; bcopy() has never been standard.
The ENABLE_THREADS handling has changed to be set to 0 when threads
are not in use. This breaks expressions like #ifdef ENABLE_THREADS.
Replace with a slightly more complicated expression. It might have
been better to fix the configure.ac script, but I didn't know how and
this whole setting is likely to go away soon anyway.
The MinGW C runtime actually does include snprintf, so only MSVC
builds (and not all WIN32 ones) need _snprintf in JSBSim/FGState.cpp
Building on a platform with no glut at all exposed some spots where
plib/pu.h was being included without a toolkit setting (it defaults to
glut). Include fg_os.hxx first.
And when still using glut, glut.h has a bizarre dependency on a
_WCHAR_T_DEFINED symbol. It it's not defined, it tries to redefine
(!!) wchar_t to disasterous effect.
Replace axe by axis. Make sure the right number of joystick buttons is used. The number of defined buttons does not always equal the maximum number of allowed buttons.
Revert the previous patch. The <target-platform> tag is not supported
anymore. Instead Frederic Bouvier suggests to add a <number> tag to
the axis definition which accepts values for <windows> and <unix>
for now but which can be extended later on:
1. The listener is always positioned at the origin.
2. All sounds eminate from the aircraft's model position.
3. Sound positions are relative to the listener location.
Make it possible to define a <target-platform> tag in the joystick configuration file. This would make it possible to have different configuration files for Windows. Possible values are: Windows, UNIX or All. Not specifying the tag equals to 'All'.
I've added a tracking bug to the gps. This is of course very similar to a
heading bug for a DG. I don't know if this is the common name, but I feel
that for a gps the name tracking bug is more accurate than heading bug. A
true bug error and a magnetic bug error is calculated and shifted into the
-180 to 180 range so that they can be used by autopilots.
I've also fixed a property name that crept in when I had to change back to
indicated-***. Back then I accidentally changed the desired course name to
"indicated-course". The property that is supposed to be the input for the
desired course should naturally be named something like "desired-course", and
definitely _not_ "indicated-course". If this name change breaks anything it
should be fixed in the other end.
I've also commented out a lot of #includes that I don't think is needed. I'm
on Suse 9.0 now, and it builds fine here, but this might be a problem for
different platforms I guess we have to cross our fingers.
Fix a seg fault that could be caused if all no AI models were in existance. Ssg could then free the memory pointed to by our pointer behind our back, causing it to crash when next approaching a controlled airport requiring an AI model. Fix is to hold one ref to each model in the AIMgr at all times.
andy [Tue, 6 Apr 2004 04:06:11 +0000 (04:06 +0000)]
Added mouse cursor definitions stolen from the X11 cursor font (via a
pointer from Melchior to a font editor that could read .pcf and
generate image files)
andy [Tue, 6 Apr 2004 03:51:11 +0000 (03:51 +0000)]
Oops. A change to an upstream header seems to have remove glu.h, which
these files require. Dunno why my build didn't pick up the transitive
dependency.
andy [Mon, 5 Apr 2004 21:39:32 +0000 (21:39 +0000)]
Early-access version of an SDL implementation of the fg_os API. It works,
but is not integrated into the build process. It also lacks support for
changing mouse cursors, which works rather differently in SDL vs. Glut.
andy [Mon, 5 Apr 2004 19:38:50 +0000 (19:38 +0000)]
Revert the hard-coded keybindings I just replaced, and turn them into real
command bindings accessible from XML. This still probably isn't a final
solution (which would drive the HUD from propery values), but it's a step
in the right direction anyway.
This update contains a change to not overwrite the altitude-ft preset during
"onground" start. The change also prevents a ground trim issue with the
JSBSim fdm when a "reset" is done by FlightGear.
this patch is to clear a problem that I sometimes
encounter : FG locks when hitting the cancel button
of a dialog. In fact, an interator is always invalid
when it was used to erase a member of a collection.
The braces are here to help my debugger, and I also
removed a warning about unused variable.
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;