1
0
Fork 0
Commit graph

382 commits

Author SHA1 Message Date
curt
29e72b0b90 Various tweaks and fixes to navcom radios.
Oops, taking the address of a temporary in main.cxx: 3dcloud rendering.
2002-09-23 18:44:09 +00:00
curt
578073a6f3 Slightly cleaned up 3d cloud positioning code. 2002-09-23 13:34:51 +00:00
curt
e23b22fabe There is something wierd about moving the cloud base around, let's just leave
it rooted in place until we sort out the positioning.
2002-09-22 23:07:01 +00:00
curt
ab49022465 Patch to position 3d clouds at center of <current> tile. This means the clouds
jump whenever you cross a tile, but there are currently a lot of other
positioning problems as well, so this doesn't really detract too much and
means you can play with 3d clouds from just about any starting point.
2002-09-20 15:30:54 +00:00
david
2d7d0034d0 Do 3D cloud state changes only when 3D clouds are selected. 2002-09-20 14:01:06 +00:00
curt
53b9eacf74 Stabalize cloud shading. 2002-09-19 02:21:23 +00:00
curt
b350c6cd0f Miscellanious flailings trying to get 3d cloud imposter rendering to work
correctly.
2002-09-19 01:27:49 +00:00
curt
e0a7536e55 Erik Hofman:
This patch shows fatal error messages even when ./configure --disable-logging
is specified.
2002-09-18 16:13:08 +00:00
curt
c5f7f15f5b Updated from Norman to hack on clouds ... some progress. 2002-09-18 14:57:20 +00:00
curt
cc87fb93ba Updates for 3d cloud rendering. 2002-09-16 14:56:16 +00:00
curt
73c4fd481d Changed the clouds3d header install directory. 2002-09-15 04:32:49 +00:00
curt
82c87b2456 Updated the base package version required. 2002-09-14 01:58:40 +00:00
curt
bdde29e203 Update base package version. 2002-09-13 23:37:55 +00:00
curt
a4b3e35c0e Stubbed in initial support for 3d clouds. 2002-09-13 20:38:15 +00:00
curt
ed4a2e6db6 Darrell Walisser:
This allows it to behave like a certified Mac OS X citizen.
2002-09-10 19:43:33 +00:00
david
d4f92d6aff Removed unused cur_view_fdm variable as suggested by Bernie Bright. 2002-08-31 19:48:28 +00:00
curt
25c4d9b620 Minor tweaks to sound subsystem update rates. 2002-08-26 20:46:13 +00:00
curt
ee35eecb54 Erik Hofman:
I removed some pending random code and I also fixed a
small cosmetic glitch where dt_play was cleared before it was printed.

Curt: Erik changed the sound update intervale and I further I tweaked it.
The issue is that if we put too much into the sound buffer, then we can't react
quick enough to sounds like tire squeek that need to be synced with the visuals
and the action.  We put too little into the sound buffer and we risk the
audio dropping out for moment if a frame takes longer to draw than the amount
of audio in the buffer.
2002-08-25 23:27:00 +00:00
curt
df6989a37a Bernie Bright:
Here is a FGIO class derived from FGSubsystem that replaces the fgIOInit()
and fgIOProcess() functions.  The FGIO::update(double delta) doesn't use the
delta argument yet.  I suspect it could be used as a replacement for the
calculated interval value but I'm not familiar enough with that piece of code
just yet.

I've also added two "command properties" to fg_commands.cxx that select the
next or previous view.  Writing any value to these properties triggers the
corresponding action.  As an example I modified my keyboard.xml:

 <key n="118">
  <name>v</name>
  <desc>Next view</desc>
  <binding>
   <command>property-assign</command>
   <property>/command/view/next</property>
   <value type="bool">true</value>
  </binding>
 </key>

 <key n="86">
  <name>V</name>
  <desc>Prev view</desc>
  <binding>
   <command>property-assign</command>
   <property>/command/view/prev</property>
   <value type="bool">true</value>
  </binding>
 </key>

And of course these actions can also be triggered from external scripts via
the props server.
2002-08-25 20:56:16 +00:00
david
0ebe8ec8f0 Removed the FG3DModel class and replaced it with fgLoad3DModel.
Animations are now contained within the scene graph itself and are
updated whenever the graph is traversed -- that saves time by not
updating animations not currently in sight, and it allows animations
to be used for static objects and random objects as well.

Added new FGModelLoader and FGTextureLoader classes.  These are intern
tables for models, to guarantee (mostly) that no model is loaded more
than once.  FGTextureLoader is not yet used anywhere, but
FGModelLoader is now in place everywhere that ssgLoad* used to be
used (thus adding the ability to use animations).

In the future, FGModelLoader will add some interesting functionality,
including the ability to reload 3D models on the fly.
2002-08-07 01:34:49 +00:00
curt
94c44fc172 A couple fixes to the network fdm interface. 2002-07-30 04:37:16 +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
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
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
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
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
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
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
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
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
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
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
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
curt
73b92a697d Further restructuring of the scenery loading code. 2002-03-03 23:20:55 +00:00
david
7e93fca8ee Virtual cockpit patches from Andy Ross:
What the attached patch does is map your panel definition onto a (non
z-buffered) quad in front of your face.  You can twist the view around
and see it move in the appropriate ways.

Apply the patch (let me know if folks need help with that step), and
then set the /sim/virtual-cockpit property to true.  You can do this
on the command line with --prop:/sim/virtual-cockpit=1, or via the
property picker.  Bind it to a key for fast toggling if you like.

The default bindings don't allow for "panning" the view, so you'll
have to modify yours.  These are the mappings to my joystick's hat
switch, for those who need hints:

   <axis n="6">
    <desc>View Direction</desc>
    <low>
     <repeatable>true</repeatable>
     <binding>
      <command>property-adjust</command>
      <property>/sim/view/goal-offset-deg</property>
      <step type="double">1.0</step>
     </binding>
    </low>
    <high>
     <repeatable>true</repeatable>
     <binding>
      <command>property-adjust</command>
      <property>/sim/view/goal-offset-deg</property>
      <step type="double">-1.0</step>
     </binding>
    </high>
   </axis>

   <axis n="7">
    <desc>View Elevation</desc>
    <low>
     <repeatable>true</repeatable>
     <binding>
      <command>property-adjust</command>
      <property>/sim/view/goal-tilt-deg</property>
      <step type="double">1.0</step>
     </binding>
    </low>
    <high>
     <repeatable>true</repeatable>
     <binding>
      <command>property-adjust</command>
      <property>/sim/view/goal-tilt-deg</property>
      <step type="double">-1.0</step>
     </binding>
    </high>
   </axis>

While the current implementation is happy with just plastering the
panel's notion of "screen" into the 3D world, this is actually more
general.  Each panel can, in principle, have it's own coordinate
system, and you could build a cockpit out of a bunch of them.  The
mapping is specified by providing a 3D coordinate for three corners of
the quad the panel should be mapped to; this should be pretty simple
to work with.

All that's needed for a perfectly general solution is a convention on
where to store the information (a cockpit xml file, or put it in the
aircraft -set file, or...), and some work on the panel's coordinate
system conventions (some of which don't coexist very nicely with a
generalized 3D environment).  Combine that with a plib model for the
non-panel interior of the cockpit, and we're golden.

I'm actually really pleased with this.  It worked better and more
quickly than I could have imagined, and impact on the surrounding code
is quite light -- a few property tests only.  But some stuff is still
missing:

+ No equivalent work was done to the HUD, so it still displays
   incorrect headings when the view changes.  The use of pixel
   coordinates deep in the HUD code is going to give me fits doing the
   port, I sure.  It's not nearly so well put together as the panel
   (where I just changed the setup code -- none of the rendering code
   changed at all).

+ I forgot that the panel was clickable. :)  Input events still have
   the screen coordinates, which essentially kills the interactivity
   when in virtual cockpit mode.  This won't be hard to fix; it's only
   broken because I forgot the feature existed.

And one note about the implementation choice: to get away from the
inevitable near clip plane issue, the virtual cockpit renderer simply
disables the z buffer.  This means that cockpits built using these
panels need to be z-sorted, which isn't too hard since they are static
geometry.  It also means that no two "virtual panels" can ever be
allowed to interpenetrate.  No biggie.
2002-03-03 00:06:24 +00:00
curt
348ac42c90 Attached is a reasonably large patch to add a proper ATC
subsystem to Flightgear.  No more functionality is implemented
than at present (apart from an ATIS bug-fix - station wouldn't
change if the radio was switched directly from one station to
another) but it is much neater than the current hack and should be
easily extendable.

Some cruft is still probably left over in radiostack.[ch]xx such as
the bindings to the comm frequencies but I'll leave removing those
until I'm sure they're not needed there.
2002-03-01 17:39:52 +00:00
david
d514e8c255 Major sound-effect architectural reworking from Eric Hofman, allowing
individual aircraft to have different sounds (and cleaning up my code
a fair bit).  The most important user-visible change is the renaming
of the /sim/sound property to /sim/sound/audible.
2002-02-27 15:13:58 +00:00
david
d61ce30c12 Separated 3D model-handling code from main.cxx out into its own
subsystem, FGAircraftModel.
2002-02-23 21:20:00 +00:00
david
a9a30bfd80 Added an #ifdef for compiling without --with-new-environment. Thanks
to Tony Peden for the catch.
2002-02-23 04:50:47 +00:00
david
eaf9fa7621 Added FGEnvironmentMgr to provide information on the environment in
different locations, and hitched it into FGGlobals.  FGEnvironmentMgr
has taken over as the subsystem, while FGEnvironment is simple the
information that it returns.  I've removed current_environment
completely -- everything now uses properties or goes through
FGGlobals.  FGGlobals itself has a couple of useful methods:

  const FGEnvironment * get_environment ();
  const FGEnvironment * get_environment (double lat, double lon, double alt);

The first one returns the environment data for the plane's current
position, while the second returns the environment data for any
arbitrary location.  Currently, they both return the same information,
but that will change soon.
2002-02-22 22:51:34 +00:00
curt
0a61c0da99 Fix a big where the initial ground elevation reported could be bogus
(initialization order problem.)
2002-02-22 20:20:23 +00:00
david
71f120e3be Initial take of new environment subsystem. Configure with
--use-new-environment to active it.
2002-02-19 15:16:08 +00:00
david
3b870192f4 First steps in a weather reorganization. Note especially that
properties have been renamed from wind-(north|east|down)-fps to
wind-from-(north|east|down)-fps, and the FDMs modified appropriately.
No other changes should be visible unless FG_OLD_WEATHER is defined.
2002-02-19 01:26:44 +00:00
david
93c69c4bc3 Changes from Tony Peden to fix reinit crashes (and eliminate the force
altitude function).
2002-02-17 21:05:27 +00:00
curt
465678ad07 Oops fixed one small mistake from the last fix. 2002-02-13 02:46:01 +00:00
curt
4cd24b3a67 Added a clock freeze option (/sim/freeze/clock). This can be specified
via the command line (--enable-clock-freeze / --disable-clock-freeze)
and can be toggled during a run.  However this property is not currently
bound to any menu or keystroke so you have to do it via the gui property
interface or externally via the web property browser or a script.
2002-02-13 02:37:44 +00:00