1
0
Fork 0
Commit graph

655 commits

Author SHA1 Message Date
david
0cbe8a597d Patch from Julian Foad:
Remove trailing comma (unportable).
2002-06-28 17:59:59 +00:00
david
dc132d80b1 Added fgAddChangeListener convenience functions. 2002-06-18 03:27:21 +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
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
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
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
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
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
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
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
b2cefb1450 Check for the proper base package version. 2002-05-30 15:37:39 +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
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
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
curt
e8a6836525 Bernie Bright:
Reverted fgUsage() to previous version that works on all platforms.
2002-05-17 17:01:16 +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
279643226a Temporarily modified to support changes in SGSky and SGCloudLayer;
this will soon be removed into a separate module that allows dynamic
changes to cloud layers.
2002-05-17 01:23:00 +00:00
curt
99859a5ea9 Bernie Bright:
To make MSVC happy it appears we need backslashes on string literals
spanning multiple lines.
2002-05-16 06:02:31 +00:00
curt
f9f05aa870 Bernie Bright:
Here is the new super improved telnet property interface.  CVS changelog
is at the end of this message.  Once this new telnet code is in and
compiles every where we can remove Network/props.[ch]xx.  I've added a
--telnet=<port> command line option to invoke the new server.  Later on
we could remove the --props option, or least change it to invoke the new
server.  I'll let you decide.

I've added some new commands to the telnet interface:

view next      Select the next view.
view prev      Select the previous view.
view set <n>   Select view 'n'
view get       Return index of current view

I'm not sure if these same effects could be achieved through property
operations.  The commands provide a convenient shortcut in any case.

I'm also planning on adding a panel command to manipulate panels and
objects contained therein (eg simulated mouse clicks).  There is going
to be some commonality with the command objects so we may need to
rationalize this in the near future.

Finally, I've also included my python stuff.  This is still very much a
work in progress, basically I've been using it to test the new telnet
server.  I have  tested it with python 2.2.  Feel free to add it to the
repository if you want.  I would suggest a scripts/python directory

CVS Changelog

Network/telnet.cxx: New property telnet protocol interface.  It supports
the same user interface provided by the --props server.  Additionally it
handles multiple simultaneous connections.  Added "view" command to
manipulate viewmgr.

Network/protocol.hxx: Added protocol configuration exception.

Main/fg_io.cxx:  Added new "telnet" protocol.  Added protocol
configuration parse exceptions.  Simplified protocol configuration
parsing.

Main/options.cxx: Added --telnet=<port> command line option and help
message.
2002-05-15 21:44:34 +00:00
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
49bb3306d9 Environment manager overhaul -- return a copy of an FGEnvironment
object rather than a pointer.

FGEnvironment now has the beginning of an atmospheric model, and will
recalculate temperature (not pressure or density, yet) based on
elevation.

FGEnvironment has a copy constructor.
2002-05-11 23:23:42 +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
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
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
david
18e36a3302 UFO FDM patches from Jonathan Polley:
I have finished working the bugs out of my "Enhanced" version of the Magic
Carpet FDM.  The UFO FDM works the same as the Magic Carpet with the
following exceptions:

The aircraft's pitch is determined by the Elevator setting (with a pitch
rate of 45 degrees per second).
Climb is forward velocity * sin(pitch)
Speed is forward velocity * soc(pitch)

Roll is tied to the aileron (again, with a roll rate of 45 degrees per
second)
Turn rate is sin(roll) * 45 degrees.

Yes, this does mean that turning is quite a bit more sluggish than
climbing.

If you are wondering why a UFO FDM, it is because it's best that I not
replace the existing magic carpet and this FDM does behave like a UFO (it
hovers, can spin and pitch while hovering, and does not obey the laws of
physics ;)
2002-04-25 16:23:16 +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
17106105bb Fix for reset causing view problems when not in pilot view. 2002-04-21 03:27:34 +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
david
89324e0cfe Explicitly include model.hxx, since acmodel.hxx no longer includes it. 2002-04-20 14:08:06 +00:00
curt
f1d8d554d0 Jim Wilson:
Fix a scrolling problem where last item doesn't show in prop_picker.
Removed include for unreferenced header in viewmgr.
2002-04-19 15:36:51 +00:00
david
eea531fbf5 Stop the sound when paused. We really need a separate control for
muting, but that will have to wait until someone has time.
2002-04-19 04:00:02 +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
7432b9c590 Patch from Jim Wilson:
Fix for problem where an incorrect frame or two got slipped in while
changing tiles.  Corrections to authorship in file level comments.
2002-04-13 16:25:49 +00:00
david
39416c2855 Patch from Jim Wilson:
Minor fixes.  Made some changes to get lighting correct for time of day
for now. MSVC compatibility fix and returned to clearing z-buffer only in
LOOKFROM (formerly pilot view).

[dpm: removed the last one, since I had already made a similar patch]
2002-04-13 13:11:34 +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
b3a3c0fbac Updated licensing terms to GPL since this file inherits a goodly proportion
of previously GPL'd code.
2002-04-11 16:40:59 +00:00
curt
9f8c4f9600 MSVC fixes. 2002-04-11 16:35:37 +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
curt
39fcbc93ba Finally getting around to being able to specify host name and ports for
remote fdm application.
2002-04-11 05:40:34 +00:00