1
0
Fork 0
Commit graph

1836 commits

Author SHA1 Message Date
david
c33c58476e Load models before counting them. 2002-07-26 19:04:40 +00:00
curt
94b6d4fed5 Oops, remove some unwanted debugging output. 2002-07-26 17:00:18 +00:00
curt
8c7fe4c328 Fixed some signed vs. unsigned warnings. 2002-07-26 16:54:40 +00:00
david
88758e60b4 Added --random-wind command-line option. 2002-07-26 02:49:14 +00:00
david
f8d4cb36b2 Fixed reporting of winds, cloudbase, and altimeter setting. The
temperature is still wrong.
2002-07-26 02:48:56 +00:00
david
0178c65981 I totally misunderstood sgFrustum. This patch should put it right,
and also adds an optimization to avoid traversing anything closer than
1000m.
2002-07-26 01:52:51 +00:00
curt
27158525a9 Restructure the way tile freeing is handled. When a tile is removed from
the tile cache it's ssg elements are disconnected from the main ssg scene
graph, and then the tile is thrown on the end of a delete queue.  The
tilemgr->update() routine runs every frame.  It looks at this queue and if
it is non-empty, it incrementally frees the compents of the first tile
on the queue.  When the tile is completely free it is removed from the queue.

The amount of time to free the memory for even a single tile can be quite
substantial, especially with the increased overhead of dynamic/random
ground objects.  This change allows the system to spread the work of freeing
tile memory out over many frames so you don't get a noticable single frame
hit or stutter.
2002-07-25 23:59:04 +00:00
curt
96d499f4f1 Restructuring how tiles are freed to allow us to eventually spread the task
out over multiple frames.
2002-07-25 21:57:58 +00:00
david
d86a513997 Fix random seeds to avoid coincident objects but still ensure
consistency.
2002-07-25 20:30:51 +00:00
david
9bf3c10743 Change the extra culling to do only a quarter of the scene every 200
frames rather than the whole thing, to avoid tiny stutters.
2002-07-25 17:47:42 +00:00
david
e7e576055f Added a new range-selector layer above each tile. That way, by
default, each tile has only 3 extra SSG nodes unless it falls into
range.
2002-07-25 17:32:31 +00:00
david
1c35d89eb4 Fix a problem with the culling of out-of-range random objects. When
the triangles containing the objects were out of the view Frustum,
they were never traversed by ssg (and thus, never culled).  Now, every
200 frames, do a pass through the whole scene graph with cull-testing
disabled and without drawing anything; that will allow random-objects
to be collected incrementally.
2002-07-25 17:29:08 +00:00
curt
493fcadacd Save state before drawing '3d' panel, and then restore it after. 2002-07-22 21:09:42 +00:00
curt
e85939a814 Removed some redundant glLight() calls. 2002-07-21 17:03:29 +00:00
curt
f330ae1234 Patch to explicitely control the specular lighting component. 2002-07-21 15:40:51 +00:00
curt
750fcc7a86 Support for fuel selector switch. 2002-07-21 15:40:20 +00:00
david
140774b1e2 Renamed /sim/rendering/dynamic-objects to
/sim/rendering/random-objects, and changed the default from false to true.
2002-07-20 23:11:27 +00:00
david
3f174a15cd Added more documentation. 2002-07-20 23:10:42 +00:00
david
6ca17098b8 Added --disable-random-objects and --enable-random-objects options. 2002-07-20 23:10:16 +00:00
david
ab91bbe17a More efficient version of get_bounding_radius from Norm Vine. 2002-07-20 19:23:44 +00:00
david
d6f9038a25 Enforce a sane minimum of 1000m for coverage, to avoid run-away object
placement.
2002-07-20 18:41:17 +00:00
david
29268401b2 Randomly-place object overhaul and enhancements
-----------------------------------------------

Fixed a segfault on exit.

Changed the radius of the dummy bounding sphere from 10m to 1000m to
ensure that FOV culling doesn't leave anything out.

Allow an object to have more than one variant model, which will be
chosen randomly.  Simply repeat the <path>...</path> property.

Removed the <billboard> property and replaced it with <heading-type>,
which can be set to "fixed" (leave the model oriented as it is),
"random" (give the model a random heading between 0 and 359 deg), or
"billboard" (always turn the model to face the camera).  The default
is "fixed".  Models look much better when they are not all facing the
same direction.

Allow the user to group models with the same visual range, so that
there can be *many* fewer nodes in the scene graph when the models are
not visible.  This causes an XML-format change, so that instead of

  <object>
   <range-m>...</range-m>
   ...
  </object>
  <object>
   <range-m>...</range-m>
   ...
  </object>
  ...

we now have

  <object-group>
   <range-m>...</range-m>
   <object>
    ...
   </object>
   <object>
    ...
   </object>
   ...
  </object-group>

Every object in a group can still have its own model(s), coverage, and
heading-type, but they all share the same range selector.

This change should already help users with tight memory constraints,
but it will matter much more when we add more object types -- for
example, we can now add dozens of different urban building types
without bloating the scene graph or slowing down the LOD tests for
tris that are out of range (i.e. most of them).
2002-07-20 14:56:37 +00:00
david
cecedd302b Moved object information into a new subclass of FGNewMat, and changed
the property name from coverage to coverage_m2.
2002-07-20 01:51:27 +00:00
david
e5f4da0e9a Problem reported by Erik Hofman:
Replaced left-over std::cout statements with SG_LOG statements.
2002-07-18 22:38:46 +00:00
david
35e67c3a31 Patch from Cameron Moore:
* Rearranged member initializers
2002-07-18 22:33:10 +00:00
david
973ffbf289 Patch from Cameron Moore:
* Fixed (un)signed comparisons
2002-07-18 22:32:50 +00:00
david
bf1e7c7881 Patch from Cameron Moore:
* Rearranged member initializers
2002-07-18 22:32:32 +00:00
david
ed917f8661 Patch from Cameron Moore:
* Fixed (un)signed comparisons
* Rearranged member initializers
2002-07-18 22:32:12 +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
ec637e33d3 Patch from Cameron Moore:
* Fixed uninitialized MaxAileron value (set to 0.5)
2002-07-18 22:31:19 +00:00
david
c814eb3a1e Make objects appear more smoothly and reliably. 2002-07-18 19:16:47 +00:00
david
4ab343569f More efficient rotation matrix calc from Norm Vine. 2002-07-18 15:54:21 +00:00
david
f4cfe4c207 Significant speedup for randomly-placed objects, by taking better
advantage of ssg Frustum culling.
2002-07-18 13:23:29 +00:00
david
f7a17c9020 Modifed random-object code for more memory efficiency:
1. Only one copy of each object (and its texture) is stored in memory,
   no matter how many materials use it.

2. Random objects are added to a triangle only when the objects are in
   range, and they are deleted as soon as the objects are out of
   range.  That way, only a relatively small number of ssg nodes are
   used at any one time.

This patch seems to eliminate freezes when tiles are freed.  There are
occasional stutters at extremely high speeds (i.e. over 3,000kt), but
it seems smooth enough for normal aviation speeds.
2002-07-18 01:04:08 +00:00
david
cc8567ad63 More functional decomposition and documentation. 2002-07-17 22:11:13 +00:00
david
5d2c640f1a Fix some minor inconsistencies and inefficiencies:
- no extra nodes are created at all if the material has no random
  objects defined

- the range selector is place correctly under the transformation

- there is only one range selector for each object type in each
  triangle (experimental -- doesn't seem to make a difference in speed
  or memory)

This patch removes Curt's patch that randomized ranges slightly, since
individual random objects no longer have their own range selectors.
It also leaves the object-group-range value unused, for now.
2002-07-17 21:00:54 +00:00
david
f71f4cf9ab Started functional decomposition for dynamic objects.
Fixed typo in last patch, where objects were using object_group_lod
rather than object_lod.
2002-07-16 23:39:53 +00:00
curt
8dc38a5198 put a separate LOD node in front of ever random object so we can randomize
the exact pop in location of each object ... this allows us to put some objects further out and perhaps hide the popping just a tiny bit?
2002-07-16 20:43:40 +00:00
david
84fcb479f6 Added support for dynamically-generated scenery objects. Set the
property /sim/rendering/dynamic-objects to true to enable them.
2002-07-15 18:16:20 +00:00
tony
f04d342f6a Member variable initialization fixes from Cameron Moore 2002-07-11 00:19:19 +00:00
tony
e0fa2db2c9 Fixed typo in SetGammaFallback() 2002-07-10 03:24:57 +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
ee8c5d0a3a Patch from Julian Foad:
The present sets of bindings result in the throttle being "squared"
about its centre, which is silly.  This is because the "squared"
parameter is not set by the throttle binding, but the default is
"true".  We discussed this before and I think there was general
agreement that the default should be "false" on the basis of
generality.
2002-07-06 18:02:06 +00:00
david
0f3db24a90 Patch from Julian Foad:
May I offer this patch which will help non-Linux users find their
joysticks' names.
2002-07-06 18:00:34 +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
b17e1bb7c0 Update controls so we can specify each tank on/off individually. Also
updated the network interface files to add fuel tank selector information.
2002-07-05 19:04:04 +00:00
curt
eab0479417 Oops, fixed a typo. 2002-07-05 14:49:18 +00:00
curt
6d3204eedd Added a fuel selector switch. I understand that this won't handle all
situations for every kind of airplane.  But at the moment we have nothing
implimented and this will cover the simpler cases until someone has a
chance to impliment a fuller solution.
2002-07-05 14:46:38 +00:00
curt
1c91723cef Switch to snprintf() for safety. 2002-07-05 13:56:46 +00:00
curt
01f846feb2 MSVC fixups. 2002-07-05 05:23:53 +00:00
curt
667f9e0dbf Added interface to ATC xponder hardware. 2002-07-04 21:38:37 +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
david
1669820bba Modified to use named-joystick bindings when available (js-named
rather than js).  This functionality is available only with recent CVS
plib versions (i.e. since about May 2002).
2002-07-04 17:38:18 +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
961804b03e Patch from Dave Luff to use dt properly in CHT calculation. 2002-07-03 04:13:28 +00:00
david
b3bb53b67f Fix a bug reported by Frederic Bouvier:
GL/gl.h can't be included at the first position in windows. It requires
the inclusion of windows.h that must be included in other fgfs header
file. I only move down #include <GL/gl.h>
2002-07-03 04:09:27 +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
a28b35f3f2 Fixes for IA-64 with Intel compiler. 2002-07-02 20:45:02 +00:00
curt
dee32ef826 Updated hardware interface to match new KR 87 features. 2002-06-30 22:46:34 +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
curt
79a7c1c9ce Allow the default GUI font to be set via properties. 2002-06-29 13:07:25 +00:00
david
51d3edaafa Patch from Melchior Franz:
This patch eliminates about 10 of valgrind's "Use of uninitialised
value of size ..." messages. They are all caused by approachlist building
incomplete FGApproach class instances and then copying them into the
approchlist container, hence copying data garbage.
   I know, I couldn't win a beauty contest with this patch, but the
alternative approach -- letting operator<< always leave complete
entries -- didn't look any better. And I do only add those seemingly
useless initialization where the values would be used uninitialized
else. The constructors are only run during setup and won't slow fgfs
down at runtime.
2002-06-28 19:14:42 +00:00
david
0c4c182f1e Fixed an uninitialized variable reported by Frederic Bouvier; this
could cause the FDM occasionally to get caught in a very long loop.
2002-06-28 19:06:23 +00:00
david
a26ea45c43 Update from JSBSim - fix bugs reported by Gonzalo Peralta with CHT and
oil pressure.
2002-06-28 18:38:28 +00:00
david
140f58b4ca Patch from Julian Foad:
Use defined constant instead of yet another approximation to pi.
2002-06-28 18:00:49 +00:00
david
048da049f8 Patch from Julian Foad:
Make locally-used strings local instead of global.  (The safety and
cleanliness benefit outweights the slight performance hit.  If
performance is an issue, the way these strings are used should be
optimised.)  Use existing defined constant instead of a literal
number.
2002-06-28 18:00:21 +00:00
david
0cbe8a597d Patch from Julian Foad:
Remove trailing comma (unportable).
2002-06-28 17:59:59 +00:00
david
343fb01972 Patch from Julian Foad:
Remove redundant class scope qualifiers.  (Should not be used within
class definition.)
2002-06-28 17:59:44 +00:00
david
cd59f77c40 Patch from Julian Foad:
Remove unused variable.
2002-06-28 17:59:30 +00:00
david
72fbb0f3f5 Patch from Julian Foad:
Newline at end of file is required.  (On a preprocessor line it is
required; on other lines it is recommended but not required.)
2002-06-28 17:59:13 +00:00
david
0d48bae1ef Patch from Cameron Moore:
The patch fixes the uninitialized values by explicitly starting
everything at sea_level values.
2002-06-28 17:41:18 +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
004359f0e8 Updates to the OpenGC interface from John Wojnaroski. 2002-06-27 22:26:47 +00:00
curt
a6c192911d Initialize a value so we don't see non-deterministic behavior. 2002-06-27 20:48:39 +00:00
andy
b162cf8707 Wrong units when interpreting <weight> tags. 2002-06-24 04:18:53 +00:00
andy
8199ece7dc Hack in an /accelerations/pilot-g property, for testing a new panel
instrument.  This needs to move somewhere permanent.

Also, remove a bogus fuel consumption setting that (1) was off by a factor
of 3600 (hours, not seconds) and (2) collided with identical code in FGFDM.
2002-06-20 04:11:19 +00:00
david
6df9479415 Allow an empty virtual model, to which other submodels can be attached
(when no path is specified).
2002-06-19 03:25:40 +00:00
david
9569c43126 Avoid a segfault when a named object is not found for an animation.
Ensure that global animations are applied to the model.
2002-06-19 02:58:06 +00:00
david
dc132d80b1 Added fgAddChangeListener convenience functions. 2002-06-18 03:27:21 +00:00
curt
ee98995d30 Updated to match changes in radiostack.[ch]xx 2002-06-16 15:23:22 +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
andy
9541e06a1e Finally fixed the flap drag issue. Drag modifications need to be based on
the amount of drag that the produced lift *would* have produced given an
unflapped air surface.  A nifty trick involving the assumption that AoA is
small works for this, and produces plausible results in the high AoA case
as well.

Also, trim for approach using the elevator-trim control, not elevator.
Just cosmetic for current planes, but future ones might have differing
implementations of trim.
2002-06-15 05:40:02 +00:00
curt
22a55b25f9 Erik Hofman:
Specify default values for properties so we get expected behavior when
an option isn't specified in the sound config file.
2002-06-14 15:29:20 +00:00
curt
1bb0cbf0a7 Andy Ross:
Fixes for uninitialized variables.
2002-06-13 19:22:32 +00:00
curt
6800231cfa Erik Hofman:
This is the small code fix which is needed for the new options.xml file.
It is needed because otherwise the "--prop:name=value" is showed
incorrectly.

There is another problem though, when compiling with --without-logging
the help message isn't displayed at all! We *must* change that somehow.

Curt: good point, the SG_LOG()'s have been switched to cout's ...
2002-06-12 16:38:46 +00:00
andy
a682823ada Bugfix. The engine thrust is recalculated based on the current N1 value
(and not the throttle setting), but the recalculation left in a degeneracy
when the target/throttle setting was exactly zero.  Zero times a big number
is still zero.  Fixed to use real math, not theoretical math.
2002-06-12 08:23:05 +00:00
curt
2c5eb44cc3 Updates to the 610x interface:
- More progress with proper radio freq tuning and proper interpreting of the
  hardware values.
- Filter ignition and flap switch values since the hardware implimentation has
  a dead zone where the value can go to zero in the middle of a change in
  switch position.
2002-06-12 06:16:23 +00:00
curt
c93b79641d Erik Hofman:
I've updated the FIXME in the code, and fixed a typo (descr instead of
description), but the SG_LOG() functions doesn't produce any output for
me. Could you confirm it's still working for you?

Curt Olson:
I did a bit of further tweaking and it all looks good now.  The tricky thing
is that SG_LOG() always appends an endl at the end of every message.
2002-06-11 17:06:46 +00:00
curt
a4e81f4ff0 Erik Hofman:
This patch solves an unknown reference to a function which showed up
when using no-inlining.
2002-06-11 16:32:12 +00:00
curt
7d3448294b Erik Hofman:
This is an enhanced version of the options patch.
It's more robust now, and gives some helpful information if something
goes wrong. Also the naming in the options.xml file has changed to the
syntax David suggested.

Since no one objected to the patch I think it is safe to included it.
2002-06-10 23:30:23 +00:00
andy
df2b147ef5 Really simple command line airplane compiler. Basically a test program;
not integrated into the Makefile.am stuff.
2002-06-10 20:15:35 +00:00
david
a74c184cfb Separate the model geodetic position and orientation into a separate
class, FGModelPlacement, while FG3DModel retains control of animation.
This way, we can have a single, top-level placement, but multiple
layers of nested models underneath.  To include a nested model, use
something like this in the XML wrapper:

  <model>
   <path>Models/Stuff/my-component.xml</path>
   <offsets>
    <roll-offset-deg>45</roll-offset-deg>
   </offsets>
  </model>
2002-06-10 13:20:26 +00:00
andy
0cabedaa4f Use the density values from the environment subsystem, to properly handle
density variations due to humidity.
2002-06-10 08:47:29 +00:00
david
f12ba10c47 Modified --wind=DIR@SPEED option to allow both DIR and SPEED to
contain colon-separated ranges.  For examples, winds from 180 degrees
10 knots gusting 15 knots would be

  --wind=180@10:15

Winds variable from 180-220 degrees 5 knots would be

  --wind=180:220@5

FGEnvironment does not yet support variable-direction winds, so
nothing will yet happen in the second case.
2002-06-09 21:28:17 +00:00
tony
9299767541 Oops. Previous versions caused compile errors 2002-06-08 03:20:37 +00:00
tony
0975a42f49 The external atmosphere fix. Really this time. 2002-06-08 03:15:05 +00:00
tony
00dcf9f507 JSBSim updates, including external atmosphere fix 2002-06-08 03:14:03 +00:00
curt
0ba0a278b9 Patch from Norman to do the code/base version comparison check a little
more sensibly (and print the correct error message.)
2002-06-07 23:26:07 +00:00
curt
8b711a5782 James Turner:
Modifications to support querying navaid database by station ID (not just
frequency.)  Some corresponding changes to testnavs.cxx to test new
functionality.
2002-06-07 21:03:27 +00:00
david
bc179de4bd Patch from Jim Wilson:
This is a small patch that makes the autopilot work much better with big heavy
airliners as well as the small Cessnas.  Of course this doesn't address the
way autopilots should be modeled.

But by making a couple changes the "George" is now capable of landing either a
C172 or a 747 very close to the center line of the runway with a moderate
cross breeze (15-20kt).

The changes:
- Added turn configurability so that things like Max Aileron and Roll can be
configured per aircraft.
- Enhanced localizer routine (NAV mode) to begin lining up the aircraft as soon
as the cone is entered.  The former model is adopted for the last 5km of the
approach in order to ensure greater precision (makes a very slight difference).

[float cast added by David Megginson to keep G++ 3.0 happy]
2002-06-07 20:16:54 +00:00
david
88e93dc767 Patch from Jim Wilson:
This is a small patch that makes the autopilot work much better with big heavy
airliners as well as the small Cessnas.  Of course this doesn't address the
way autopilots should be modeled.

But by making a couple changes the "George" is now capable of landing either a
C172 or a 747 very close to the center line of the runway with a moderate
cross breeze (15-20kt).

The changes:
- Added turn configurability so that things like Max Aileron and Roll can be
configured per aircraft.
- Enhanced localizer routine (NAV mode) to begin lining up the aircraft as soon
as the cone is entered.  The former model is adopted for the last 5km of the
approach in order to ensure greater precision (makes a very slight difference).

[float cast added by David Megginson to keep G++ 3.0 happy]
2002-06-07 19:52:00 +00:00
david
e6f9caa41b Patch from Melchior Franz:
FGViewer::updateFromModelLocation does otherwise complain several
times about non-initialized values
2002-06-07 19:43:40 +00:00
david
d982efc4c4 Fix two problems:
1. Typo where /environment/density-inhg instead of
   /environment/density-slugft3 was flagged as archivable.

2. Density should no longer be archivable anyway, since it is
   calculated internally and not directly settable by the user.
2002-06-07 14:23:09 +00:00
david
a08d92e142 Correct temperature value passed to FDM. 2002-06-07 00:15:21 +00:00
david
56642901b5 Air density is now calculated automatically from air pressure,
temperature, and dewpoint.  The /environment/density-sea-level-slugft3
property has been removed, and the /environment/density-slugft3
property is read-only.
2002-06-06 00:21:23 +00:00
david
4acb59a020 Renamed property /steam/vertical-speed-fpm to /steam/vertical-speed-fps. 2002-06-05 22:39:00 +00:00
david
2df334378f Use factors instead of offset in atmosphere model. The troposphere is
hard-coded for 38,000ft.
2002-06-05 22:30:07 +00:00
david
34e2e52158 Patch from Georg Kaiser. 2002-06-05 21:43:44 +00:00
david
890c26a9ee Move initial setup of cloud layers to Main/main.cxx to ensure that
they are done only once, and ensure that all properties are untied in
unbind().
2002-06-05 17:45:42 +00:00
david
5bec60a602 Set up cloud layers when thesky is allocated, to ensure that they are
created only once.
2002-06-05 17:44:39 +00:00
david
0387b3a4ec Replace cout statement with SG_LOG. 2002-06-05 17:44:09 +00:00
david
384c3c254a Initialize default SLP to 29.92inHG. 2002-06-05 14:44:30 +00:00
curt
e2e640ef46 Set control surface positions when using an external network fdm.
Fetch all pending remote fdm network packets so there is not chance of
  getting behind.
Add support for driving control panel lights.
Working on better modeling KX 155 tuning behavior.
2002-06-05 05:22:42 +00:00
curt
63eb4d8668 Erik Hofman:
* Small updates and fixes
* Add random as an internal ( <intenral>random</internal> is now possible)
2002-06-04 16:27:20 +00:00
andy
2852f27bdc Uninitialized data problem. As it turns out, this never bit us because
the _chord member is only used uninitialized in circumstances where the
result is thrown away.  Still, bad practice.  Found with valgrind.
2002-06-04 07:23:34 +00:00
curt
11766afb6c Added flap_deflection so that remote fdm can pass back actual flap deflection
in order to drive the flap sound effects and animation.
2002-06-03 23:35:43 +00:00
andy
04e083083d Need to call recalc() on the RigidBody during solution, or else it
won't apply the right gross weight due to fuel differences.

When solving for zero force, do so in the global frame, not the
aircraft's.  In principle, this shouldn't matter (zero is zero in all
frames), but in practice this should help to avoid oscillations.
Calculating lift as force perpendicular to the ground (and not the
wing plane) is clearly the Right Thing, anyway.

Also added support for a /yasim/gross-weight-lbs property, which
should be generically useful.
2002-06-01 19:59:38 +00:00
andy
713920356b Property name typo. This resulted in all temperatures being 273K,
which is far too warm at altitude.  Thus, air density (and aircraft
performance) was too low for a given altitude.
2002-05-30 18:54:08 +00:00
curt
b2cefb1450 Check for the proper base package version. 2002-05-30 15:37:39 +00:00
david
25450e040a Patch from Melchior Franz:
The new dt/multiloop method requires new damping parameters.
2002-05-29 22:38:11 +00:00
david
1a4b6a37a3 Default to glider again when model is not present. 2002-05-29 22:04:36 +00:00
andy
7e63c0f6e8 Modify solution heuristics. Do the cruise AoA and tail incidence only
when the lift/drag are really solid.  And defer the approach trim until
the all four of the other variables are perfect.  I believe this should
fix the solution failures under gcc 2.95.2.
2002-05-29 08:41:13 +00:00
andy
adeeed1a0e Oops. Stray checkin. Revert. 2002-05-29 07:09:41 +00:00
andy
f324ea9bad The incidence setting only works on a compiled object. If setIncidence
is called on a non-compiled object, make sure to re-set it after compilation.
2002-05-29 07:07:29 +00:00
david
8cf573ae51 JSBSim change:
Reverse sense of rudder surface position, for consistency with
ailerons and FlightGear controls.
2002-05-28 13:50:51 +00:00
andy
040c508aa8 We don't handle propellers turning backwards. This got clamped
implicitly in PropEngine by disallowing negative torques, but that was
removed at some point.  We really need the explosion protection here
at the source.
2002-05-23 19:47:19 +00:00
andy
6af60f7462 Yank the "castering" attribute and replace it with a ControlMap-enabled
control that can be set via the property system.  This allows implementation
of the DC-3 wheel lock.
2002-05-23 19:30:56 +00:00
andy
4d10297732 Oops, left debug code in the checkin. 2002-05-21 18:45:56 +00:00
andy
4535c84b99 Solve for the elevator control input during approach. It turns out that
the downforce from the tail due to elevator trim is a significant contribution
to total lift.
2002-05-21 07:40:46 +00:00
curt
e380891c40 Erik Hofman:
This patch adds "elapsed time" support to the sound code.
It is now possible to define <internal>dt_play</internal> or
<internal>dt_stop</internal> instead of a propery in the <volume> and
<pitch> sections of the configuration file.
2002-05-20 16:28:21 +00:00
curt
2cafd466e2 Tony Peden:
Defeated the invasion once and for all.
2002-05-20 16:19:26 +00:00
curt
8ae364a220 Jim Wilson:
This is a small fix for what turned out to be a major bug.  Ground elevation
was calculated incorrectly when distant from one of the view locations. This
resulted in several problems including bizarre gear trimming, mid air
"crashes" (as in thinking we hit the ground) and so on when close to or on the
ground.

Unfortunately it does require a second ssg traversal when in tower view
(only), but the increased load isn't all that noticable.  For the time being
this really is the best solution.  In a future update I will be eliminating
the unecessary per frame traversals for the static views (without having to
maintain multiple ssgRoots).

When we go to multiple FDM instances we will perhaps need to put the ssg
traversal and ground elevation queries for the FDMs into an event timer that
updates the FDMs ground elevation in a round robin fashion (maybe every 1/n
seconds where n is the number of FDM instances running).
2002-05-20 16:13:37 +00:00
curt
0efc08b6b6 Bernie Bright:
Ensure lines sent to clients are CRLF terminated.
Ensure the dump command null terminates its output string.
Removed view command and comments.
2002-05-20 15:53:14 +00:00
curt
1ffd296e27 Jim Wilson:
Fix for the sound cranking bug.
2002-05-17 21:02:40 +00:00
david
89483df079 No longer initialize static cloud layers (handled dynamically in
environment_mgr.cxx).  The /environment/clouds/status property is now
checked each frame, so clouds can be turned on or off in the middle of
a session.
2002-05-17 19:04:20 +00:00
david
b2dcc4ca00 Removed old --clouds-asl option and initialization of clouds-asl
property, since neither makes sense for multiple cloud layers.
2002-05-17 19:03:20 +00:00
david
fe4a837d7f Modified to work with new cloud properties (sort-of). 2002-05-17 19:02:43 +00:00
david
b091433cf6 Added support for initializing and maintaining up to five cloud
layers.  The properties controlling each layer are inside
/environment/clouds/layer[n], and the available properties are type
("clear", "overcast", "mostly-cloudy", "mostly-sunny", or "cirrus"),
span-m (should be about 40000), elevation-ft, thickness-ft, and
transition-ft.
2002-05-17 19:02:24 +00:00
david
9002aa41ff Corrected "#ifdef 0" to "#if 0" to keep ANSI-conformant compilers
happy.
2002-05-17 18:56:13 +00:00
curt
b1674cb506 From: "Jim Wilson" <jimw@kelcomaine.com>
This is a new improved patch for the previous tile manager fixes.

Rather than building dependencies between FGlocation or the viewer or fdm with
tilemgr what I ended up doing was linking the pieces together in the Mainloop
in main.cxx.  You'll see what I mean...it's been commented fairly well.  More
than likely we should move that chunk somewhere...just not sure where yet.

The changes seem clean now. As I get more ideas there could be some further
improvement in organizing the update in tilemgr.  You'll note that I left an
override in there for the tilemgr::update() function to preserve earlier
functionality if someone needs it (e.g. usage independent of an fdm or
viewer), not to mention there are a few places in flightgear that call it
directly that have not been changed to the new interface (and may not need to be).

The code has been optimized to avoid duplicate traversals and seems to run
generally quite well.  Note that there can be a short delay reloading tiles
that have been dropped from static views.  We could call the tile scheduler on
a view switch, but it's not a big deal and at the moment I'd like to get this
in so people can try it and comment on it as it is.

Everything has been resycned with CVS tonight and I've included the
description submitted earlier (below).

Best,

Jim

Changes synced with CVS approx 20:30EDT 2002-05-09 (after this evenings updates).

Files:
http://www.spiderbark.com/fgfs/viewer-update-20020516.tar.gz
 or
http://www.spiderbark.com/fgfs/viewer-update-20020516.diffs.gz

Description:
In a nutshell, these patches begin to take what was one value for ground
elevation and calculate ground elevation values seperately for the FDM and the
viewer (eye position).  Several outstanding view related bugs have been fixed.

With the introduction of the new viewer code a lot of that Flight Gear code
broke related to use of a global variable called "scenery.cur_elev".

Therefore the ground_elevation and other associated items (like the current
tile bucket) is maintained per FDM instance and per View.  Each of these has a
"point" or location that can be identified.  See changes to FGLocation class
and main.cxx.

Most of the problems related to the new viewer in terms of sky, ground and
runway lights, and tower views are fixed.

There are four minor problems remaining.  1) The sun/moon spins when you pan
the "lookat" tower view only (view #3).  2) Under stress (esp. magic carpet
full speed with max visibility), there is a memory leak in the tile caching
that was not introduced with these changes.  3) I have not tested these
changes or made corrections to the ADA or External FDM interfaces.  4) The
change view function doesn't call the time/light update (not a problem unless
a tower is very far away).

Details:
FDM/flight.cxx, flight.hxx - FGInterface ties to FGAircraftModel so that it's
 location data can be accessed for runway (ground elevation under aircraft)
 elevation.

FDM/larsim.cxx, larcsim.hxx - gets runway elevation from FGInterface now.
Commented out function that is causing a namespace conflict, hasn't been
called with recent code anyway.

FDM/JSBSim/JSBSim.cxx, YASim/YASim.cxx - gets runway elevation from
FGInterface now.

Scenery/newcache.cxx, newcache.hxx - changed caching scheme to time based
(oldest tiles discard).

Scenery/tileentry.cxx, tileentry.hxx - added place to record time, changed
rendering to reference viewer altitude in order to fix a problem with ground
and runway lights.

Scenery/tilemgr.cxx, tilemgr.hxx - Modified update() to accept values for
multiple locations.   Refresh function added in  order to periodically make
the tiles current for a non-moving view (like a tower).

Main/fg_init.cxx - register event for making tiles current in a non-moving
view (like a tower).

Main/location.hxx - added support for current ground elevation data.

Main/main.cxx - added second tilemgr call for fdm, fixed places where viewer
position data was required for correct sky rendering.

Main/options.cxx - fixed segfault reported by Curtis when using --view-offset
command line parameter.

Main/viewer.cxx, viewer.hxx - removed fudging of view position. Fixed numerous
bugs that were causing eye and target values to get mixed up.
2002-05-17 17:25:28 +00:00