1
0
Fork 0
Commit graph

295 commits

Author SHA1 Message Date
curt
487a14d05b Moved some scenery component initialization into FGScenery. 2002-05-14 06:08:28 +00:00
curt
92a58f6555 Consolodating scenery structures in scenery.hxx. 2002-05-14 05:49:47 +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
1fe50d4cd2 Removed configuration option --with-old-mouse and FG_OLD_MOUSE macro.
Removed configuration option --with-new-environment and
FG_NEW_ENVIRONMENT macro.

Added configuration option --with-weathercm and FG_WEATHERCM macro.

FGEnvironment is now the default; use --with-weathercm to get the old
weather.
2002-05-12 00:12:19 +00:00
david
ee4c3f728d Remove some dead code. 2002-05-11 21:10:11 +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
ff6943bd09 Regularized the position initialization:
1. If /position/longitude-deg and /position/latitude-deg are in range,
   use them.
2. Otherwise, if /sim/startup/airport-id is not empty, use it.
3. Otherwise, set the lon/lat to the middle of the KSFO field.

The default used to be Globe, AZ, but that doesn't make sense since we
don't distribute that scenery by default any more.

With this change, starting from a save file seems to work properly:

  fgfs myflight.sav
2002-05-01 23:13:36 +00:00
curt
6b22c85e24 Comment out ATC AI manager init() and update() calls until we can resolve
the tremendous performance hit they are imposing.
2002-04-22 22:28:00 +00:00
curt
586d767ab6 There was an integer overflow in the way elapsed_time_ms. Because the
SGTimeStamp "-" operator returns it's result in usec's, there is an upper bound of 37.8 minutes on the maximum difference this operator can reliably report
before the math overflows.  I change the global "int elapsed_time_ms" variable
to a "double sim_time_ms" and restructured how the value is calculated.
----
The practical result of the overflow bug is that a large negative dt was
passed to the event manager and the end effect was that no events would
be run until their counters caught up ... in another 37.8 minutes or so.
2002-04-20 14:52:43 +00:00
curt
4656e3adca Jim Wilson:
Minor patch for flicker glitch when crossing from one tile to another.
2002-04-19 00:25:25 +00:00
curt
71598c12f8 Jim Wilson:
These are the updates for the View manager properties.  Removed the last of
items (within the viewer/viewmgr) hard coded to view number.  Added support
for per view configuration of ground level nearplane value.  Tower views look
very nice with little or no z-buffer problem in the models.  Pilot offset
dialog can be used to move eye in all views.
2002-04-18 16:51:47 +00:00
curt
7311318e7e Small tweak to make the Irix compiler happy. 2002-04-16 17:28:57 +00:00
david
c5f6293f17 Fix for vanishing-model problem: models are drawn in the same scene
graph as the terrain, except for internal cockpit view.  The SSG
scene-graph variables (except for the lighting root -- I'll get that
later) are now held in globals.hxx.

FGModelMgr::draw() is obsolete; I'll remove it in a future revision.
2002-04-13 21:36:22 +00:00
david
8bed5a8cf4 Added support for additional animated, dynamic 3D models configured in
XML.
2002-04-12 12:45:49 +00:00
david
3bb69f35d1 Replace --with-new-mouse with --with-old-mouse, defaulting to 'no'. 2002-04-11 17:09:06 +00:00
curt
42a5ee93d7 This patch includes the FGLocation class, a few fixes, cleanup in viewer code.
Synced to CVS 19:36 EDT 2002-04-10 (after this evenings JSMsim and Base
package updates).

Description:
Added FGLocation class which is new home for calculating matrix rotations.
Viewer can now be configured to access rotations created by the model rather
than repeating the same calculations again.

Changed model initialization for the time being so that its location data is
available for the viewer (currently required by other subsystems).  At some
point we can move this back to fg_init along with the viewer initialization.

Seperated the update from the draw function in the model code.  The viewer
code needs the same matrix data, and moving the update portion at this time
does not increase the number of matrix math iterations.

Moved the model draw so that it always appears "in front" of lights and clouds.

Reogranized viewer update routine for using the FGLocation class and
simplified some more tasks.  The routine is fairly easy to follow now, with
the steps ordered and spelled out in comments.

Viewmgr only updates the current (visible) view now, with the exception of an
old reference to "chase view" that will be corrected in forthcoming changes.
Also will be doing some work on the viewmgr outputs.

Model is now clears the z-buffer in all modes.  This will be changed with the
next viewmgr update.  The only side effect is that models always disappear
when over 5km distant from the eye point (can't really see them anyway:-)).

Other than a flag to indicate "internal" view I don't anticipate the
configuration interface for viewmgr/views will be changed a lot for now.  It
is close to done.  The next viewmgr update will however rework the outputs so
may change location.

This code will run with the previous version of preferences.xml, but will run
faster with the newer version.  I am attaching a preferences.xml that should
not be commited before the code.  All the changes are in the /sim/view section
and should show a simpler view configuration that references model locations.
 Note that I've added a 2nd tower view in "lookfrom" mode for illustration
purposes. You can look around using the mouse.  You may want to remove that or
comment it out.
2002-04-11 04:26:07 +00:00
david
a82e15a653 The 3D aircraft model scene is now managed by
FGAircraftModel::update.  We should do the same thing for the scenery,
to simplify the top-level loop.
2002-04-09 21:08:28 +00:00
david
cde90e06d5 Removed current_model global variable and added a reference in
FGGlobals instead (we still need to do the same with current_input and
a few other globals).
2002-04-09 18:58:24 +00:00
david
6e5d22789b Patches from Norm Vine to improve framerate and add a new
#ifdef'ed-out mode for syncing fullscreen with user settings in
Windows.
2002-04-07 15:24:32 +00:00
david
a1294ea398 Viewer update from Jim Wilson:
Minor patches to initial tower view code.  Added calculation for "tower" at
any airport, placed a couple fractions of a degree off the center.  Moved the
farplane from 100m to 5km so that "lookfrom" mode can see the model.  5km is
still in a reasonable range for a depth buffer.  Note that looking at a model
anything but a small distance will cause some problems on older cards.
Temporarily changed viewer to always report elevation/lon/lat of the aircraft
in order to avoid a problem with the ground trim getting recalculated when
tower and aircraft are on different tiles.
2002-04-06 17:23:18 +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
ec6888d4a4 Viewer update from Jim Wilson:
Tower View and viewer config is in place.  Note that the interface is
still in a state of flux.  A couple of the config items (namely the
offsets) are still using the old settings.  The tower is hard coded
into the base package for a position off the starting runway at KSFO
and is probably not in the right place for there even.  Looks pretty
cool though!  Tower View is the third view.  If you aren't at KSFO
you'll just see blank space in view 3. It's looking through the earth or
something like that :-).  Important note: zoom in with a few
hits of the "x" key to see the plane better in tower view.
2002-04-05 18:49:04 +00:00
david
625572663e Moved FGAircraftModel subsystem out into its own directory, and
separated out a new class, FG3DModel, that allows any arbitrary 3D
model to be positioned, oriented, and animated (not just the
aircraft).
2002-04-05 03:19:34 +00:00
curt
59107c791c Various code cleanups. 2002-04-05 00:38:55 +00:00
david
f450e6d9d1 Let exceptions fall through to main, and use cerr to report them (in
case logging is disabled).  This way, when people specify a
non-existant aircraft or have an error in a custom XML file, they'll
get an error report, at least.
2002-04-04 17:51:40 +00:00
curt
fd8d48d011 Make the base package check [failed] message a bit more informative about
where it was looking.
2002-04-04 05:03:18 +00:00
david
21d8c07576 Changed cockpit near plane to 0.01m for interior view. Far plane is
100m, so it should be OK.
2002-04-04 01:32:57 +00:00
curt
7543409e47 Attached are a fairly extensive series of patches to the ATC
system.  A chap from Germany called Alexander Kappes (cc'd) got
in touch with me a few weeks ago and has written the start of
Approach control.  At the moment tuning in to a valid approach
frequency (Dortmund or East Midlands) should result in vectors to
a spot about 3 miles from the active runway, and a telling off if you
stray too far from the correct course, in the console window.  He
seems to know what he's doing so expect this to improve rapidly!!

I've added a rudimentry AI manager and a hardwired Cessna at
KEMT on the runway - I'll remove it before the next release if I don't
have it flying by then.  There seems to be an issue with framerate
which drops alarmingly when looking at it - I've a feeling that I've
possibly created several Cessnas on top of each other, but am not
sure.
2002-04-03 23:54:44 +00:00
david
0c1fa5f1a5 Changed far clip plane for cockpit interior to 100m. 2002-04-02 20:57:32 +00:00
david
6a443bb173 Start tracking delta time in milliseconds and passing it to the update
method of each subsystem.
2002-03-30 21:22:02 +00:00
david
faf2fa91d2 Patch from Jim Wilson:
Clear frame buffer and render model after rest of 3D scene. This has a
small frame rate cost (YMV). But who thought 3D cockpit would be cheap?
If anyone has a better idea, have at it!

Just did some more careful testing and I see little or no frame rate loss
with the depth buffer clear.  Also you can change the near plane to 0.1
and get rid of the "sunroof" (so I don't have to make up another set of
patches.
2002-03-30 12:52:24 +00:00
david
58e664a060 Patches from Jim Wilson:
This patch creates a seperate scene graph for the cockpit.  The near plane is
only moved up when in the interior (pilot) view.  This is because with
rounding (I presume) it the visible ground is a bit up higher than it is with
the older nearplane setting.  Not much, but it is enough to bury the wheels.
I suspected this might be true but spliting to two sg's confirms it.  If
necessary we can adjust the model up a bit when in interior view.  This might
be good so we can set the near plane even closer when in the cockpit (its
still at 0.2m).

In general this looks a lot better on my Voodoo with this patch.  No
perceptibel change in frame rate on my system.  In terms of future plans I'd
see the sense in making the model plug into either scene.  This will be
necessary when we have multiple model instances in the frame.
2002-03-28 16:14:04 +00:00
david
db7013c83a More work on the configurable mouse. Mouse motion is now configurable
as well as mouse clicks.  You must configure with --with-new-mouse to
get this.
2002-03-26 13:45:44 +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
de9682e32a Patch from Erik Hofman:
This patch gets F8 working again.
2002-03-25 19:37:49 +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
david
da621105a0 Removed unused function fgFindNode (the version used now is in model.cxx). 2002-03-22 13:24:29 +00:00
david
d0d3b2bd7a Use !strcmp for all property string-value comparisons. 2002-03-20 22:15:22 +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
96a4e9abc3 Renamed /cockpit property to /sim/view/internal. 2002-03-15 21:50:14 +00:00
curt
56fef38054 Change fog punch through value a bit. Either way it's a WAG for now, but
at least it's less obviously wrong.
2002-03-14 00:52:38 +00:00
david
45d64bef95 Centralized most view-management code in FGViewMgr. It's still a
mess, but the mess is all in one place now.
2002-03-14 00:29:20 +00:00
curt
9a27019df1 Combined and updated some code to calculate fog parameters. 2002-03-13 17:06:41 +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
0d3b0f27ba Add support for elapsed time and logging. 2002-03-12 16:30:27 +00:00
david
bdbd69effd If the (temporary) property /cockpit is true, set the near clipping
plane to 0.2; otherwise, use the old defaults.

This is a temporary step that will allow me to work on a 3D cockpit
without breaking current behaviour; the final approach will be to put
the 3D model in its own scene graph, with different clipping plane.
2002-03-06 16:01:19 +00:00
david
07ba9777ed Temporarily reverted change to near/far clip plane. 2002-03-05 22:25:11 +00:00
david
0618c2cae8 Changed the near clip plane to 0.1f regardless. Previously, it jumped
to 10m after takeoff, but that doesn't really make sense any more,
especially if models are going to have interior views.  Is there any
real saving in pushing the near plane out anyway?
2002-03-05 13:35:48 +00:00