1
0
Fork 0
Commit graph

3193 commits

Author SHA1 Message Date
david
0d3b0f27ba Add support for elapsed time and logging. 2002-03-12 16:30:27 +00:00
david
d23c674846 Bind a new property, /sim/time/elapsed-ms, giving the number of
milliseconds elapsed since the simulation began.
2002-03-12 16:29:32 +00:00
david
c22018db05 Added new logging module. 2002-03-12 16:29:00 +00:00
curt
9ff8951be6 *** empty log message *** 2002-03-12 05:37:55 +00:00
curt
c5f43ca688 Patches from Erik. 2002-03-11 22:55:52 +00:00
curt
914b5636e4 Removed some extra debugging output that wasn't supposed to be committed. 2002-03-11 22:55:01 +00:00
curt
3df76f9401 Oops, make sure we are generating an ocean tile if we can't load a terrain
tile.
Fixed a warning in the sound manager.
2002-03-11 22:50:23 +00:00
curt
9436f68f56 Cleaned up a couple compiler warnings. 2002-03-11 15:41:39 +00:00
david
bd6a57a002 Removed badly out-of-date documents on 3D models and properties. 2002-03-11 14:51:32 +00:00
david
60e0204fe8 Sound patch from Erik Hofman:
* Add new trigger types: raise, fall
* Add new trigger offset parameter
* Add new volume/pitch types: inv, abs, sqrt
* Add initial support for multiple events to intervere in a single sound
   (by using the same name, see the crank section of 172-sound.xml)
* Cached the volume/pitch type fucntions
   (No more if's inside the loops in update())
2002-03-10 19:31:30 +00:00
david
f63a99b74e Added test-env-map. 2002-03-10 19:25:00 +00:00
curt
6b40600e7b Sgi doesn't define the != operator for string != char[] so we need to cast
the char array into a (string) type before doing the comparison.
2002-03-08 23:24:59 +00:00
david
efe559ead4 First baby steps towards restructuring the view architecture. I've
created a new class, FGViewPoint (declared in viewer.hxx) that holds a
single position in FlightGear coordinates, and have used it to factor
a lot of the common code out of viewer_lookat.cxx and viewer_rph.cxx.

I don't know whether this new class will stay or not; it might just be
a temporary step, or it might end up taking over much of the current
viewer functionality.  It would be a bad idea to code against it right
now.
2002-03-06 16:03:33 +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
51b2aeb872 Temporarily rolled out last change, pending a restructuring of the
view infrastructure: vertical mouse panning wasn't working.
2002-03-06 15:54:25 +00:00
david
9ae5ad236e Patch from Andy Ross to allow virtual panel to tilt with mouse view:
OK, attached is a replacement for mouse.cxx that works the view using
the view-offset/tilt interface, rather than the (kinda odd) GuiQuat
stuff.  It's kind of a hack job, as I left the hooks to GuiQuat in in
other places for fear of breaking something.  Still, it removed more
code from mouse.cxx than it added, which has to count for some
elegance points.
2002-03-06 13:53:18 +00:00
david
0bdc1b1699 Patch from Andy Ross to hide virtual panel when required:
Oh yeah, I forgot to send that one along.  This one is my bug, I
goofed the precedence in the fgPanelVisible() function in panel.cxx
such that the panel was *always* visible if virtual cockpit was
enabled.  Here's a replacement.  I've modified the style from a single
boolean expression to an if-list, since that's more readable to my
eyes for expressions this big:
2002-03-06 13:51:05 +00:00
curt
40c83de415 Added test-env-map.cxx - an environment map demo/test program. 2002-03-06 05:05:17 +00:00
david
07ba9777ed Temporarily reverted change to near/far clip plane. 2002-03-05 22:25:11 +00:00
david
bd3900a3ff Start of an internal 3-D view. If the property "/cockpit" (temporary
and soon to be renamed) is true, FlightGear will draw the 3-D model
even in internal view.  This makes sense right now only with the C310
model, since the others don't have any kind of interiors modeled and
all surfaces in all models are one-sided.

This isn't quite working yet -- the view code is very hard to
disentangle, and currently, if the view is not forward, roll and pitch
are applied incorrectly.  It looks interesting (modulo a messy model)
on the ground, in level flight, or looking straight ahead under any
other flight conditions.
2002-03-05 13:39:45 +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
be99e1549a Fixed a bug with view-offset specification from the command line. There
was some confusion between degrees and radians which would lead to a huge
goal_view_offset value.  The display would sit and spin for a *long* time
trying to wind it's way up to this large value.
2002-03-04 20:12:30 +00:00
curt
7d8af6fee2 Fix a compiler warning. 2002-03-04 19:59:50 +00:00
curt
519ac21fa8 Fix a visibility condition bug in 3d panel. 2002-03-04 19:59:22 +00:00
curt
d8b6786d20 This patch creates a sample manager next to the sound manager. The
difference between the two is this: A sample is file related and sound
is a authonomus entity. This means you can have several sounds pointing
to a single sample. In that case, just one sample is loaded into memory.
The advantage is you can play the same sample with different pitch or
volume, but with just one  sample loaded into memory.

To fully support this there is a new fucntion call:

    FGSimpleSound *sample = new FGSimpleSound("filename");
    mgr->add(sample, "name");

should be replaced by:

    FGSimpleSound *sample = mgr->add("name", "filename");

But the old behaviour is still supported with one minor change, sounds
with the same name aren't supported anymore.

Erik
2002-03-04 16:03:11 +00:00
curt
1f5096105b Fixed a couple compiler warnings. 2002-03-04 15:46:44 +00:00
david
f477a4603b Patch from Andy Ross:
Actually, I think I'm off the hook here; the problem is pre-existing.
What's happening is that the x/y offsets enter the modelview matrix at
line 346 in the current panel.cxx.  But note that the same
transformation also occurs before each instrument rendered at line
403.  What's happening is that the instruments are double-translated
relative to the background.

Unless I'm not understanding something, the one inside the instrument
render loop looks unnecessary.  Removing it fixes the issue and
doesn't cause any bugs that I can find.  It also fixes a bug where you
could scroll the instruments on top of the 3D panel, where the offsets
are supposed to be ignored. :)

Attached is a new panel.cxx which fixes that bug, and substantially
simplifies the virtual panel code (the matrix inversion that I thought
was needed wasn't, but there were some offsetting scale bugs that hid
the problem).
2002-03-04 13:27:53 +00:00
andy
b9d1cad6f2 Export the gear compression to the property tree. 2002-03-04 07:57:43 +00:00
curt
536e95b63d Further modifications and restructuring of the scenery loading process. 2002-03-04 02:36:06 +00:00
david
f75e1b4d7b Add fake control-surface positions for 3D model animation. 2002-03-04 01:28:17 +00:00
david
b4eb6324aa Patch from Jim Wilson:
Property sort now leaves "." and ".." at top of subdirectory list in their
expected sequence.
2002-03-04 01:05:59 +00:00
david
e71873f4ad Patch from Jim Wilson:
These changes add to the "Add Waypoint" dialog so that you can see the entire
list in the pui dialog that you are adding to.  Also made some minor changes
so that the autopilot is now activated (toward first waypoint target heading)
when a waypoint is added.
2002-03-04 00:03:25 +00:00
curt
73b92a697d Further restructuring of the scenery loading code. 2002-03-03 23:20:55 +00:00
david
b9e866cfdd Added write-all parameter to save command. If set to true, the
command will save *all* properties, rather than just those marked as
archivable.  This feature was requested by Tony Peden to make it
easier to write documentation on the properties, but it should also be
useful for debugging.  There is currently no default binding for the
command with the write-all parameter set to true.
2002-03-03 22:48:40 +00:00
david
76b06f4707 Added final newline to prevent compiler warnings. 2002-03-03 22:47:06 +00:00
curt
938d006188 Updates to the scenery loading infrastructure to make it more flexible,
clean up some messiness, and lay more groundwork for runway lighting.
2002-03-03 20:29:31 +00:00
curt
9c42c9288a Added magnetos and starter to structure 2002-03-03 20:27:56 +00:00
david
b1ddb2a800 Erik Hofman's documentation for sound configuration, updated and moved
from the base package.
2002-03-03 02:07:21 +00:00
david
d83fc1e9c8 Logging cleanups from Martin Dressler. 2002-03-03 00:38:56 +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
david
0296c04e32 For property-scale, apply the squared option before factor, etc. 2002-03-02 19:40:26 +00:00
david
00738f22f7 Added min/max parameters to clamp range of movement. These are
actually very powerful when combined with factor and offset -- for
example, on the C310 model the nose wheel can now retract completely
before the doors start closing.
2002-03-02 16:07:42 +00:00
tony
173251885b Fixed gear position property. 2002-03-01 20:56:15 +00:00
curt
7631c37f73 Setting up some more ground work for lighting. 2002-03-01 18:08:30 +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
curt
a6cb16ce36 This is the change where autopilot bindings are moved from fg_props.cxx to
newauto.cxx.  Basically everything is the same functionally except for a
changed in the initial altitude setting to 3000ft instead of meters (the panel
is in feet).
2002-03-01 16:54:50 +00:00
tony
34072bbc42 Changed -pct properties to -norm 2002-03-01 12:38:37 +00:00
andy
ab381e5c01 Added a property output feature to ControlMap that allows arbitrary binding
and scaling of control values to properties.  Also added a time interpolation
feature that replaces the hacked-in "retract-time" feature for the gear in
a more general way (applicable to flaps, too!).  Incompatibly breaks
the XML syntax; get new files!
2002-03-01 06:47:28 +00:00
curt
9bae80d94a Latest version of hitlist.cxx from Norman Vine:
- Addresses some ot the recent profiling results.
- Added a 'lazy evaluation' in IntersectBranch and inlined a couple
  of HEAVILY called functions.
2002-02-28 23:59:28 +00:00
tony
03b9ecf039 Copy normalized control surface positions to property tree 2002-02-28 13:32:40 +00:00