1
0
Fork 0
Commit graph

25 commits

Author SHA1 Message Date
david
a8f40e0771 Fixed bug in timed update cycling. 2002-11-06 16:04:04 +00:00
david
e9dc716221 Added a new TimedAnimation, using the type "timed" and the property
duration-sec.  This animation may have any number of child objects,
and each one will be displayed for the requested duration before
moving on to the next one.

Added Animation::init for initialization after children have been
added to an animation.

Added a default implementation of Animation::update, and removed all
of the empty ones in derived classes.

Removed tabs from model.cxx.
2002-11-06 15:47:40 +00:00
david
68d44ac103 Removed debug print statements.
Added ability to set a name for an animation and refer to it in
subsequent animations.
2002-11-03 15:48:08 +00:00
david
351a4d5c09 Streamline to create fewer branch nodes. This involves moving some
objects around when an animation specifies more than one object.
2002-11-03 15:42:11 +00:00
david
b66a6c75b3 Patch from Frederic Bouvier:
I noticed that textures for scenery static objects are not loaded
anymore for a few weeks.  Static objects have absolute path while
random objects and aircraft have relative path but fgLoad3DModel
unconditionally prepend fg_root to the model path. This patch test the
beginning of the model path to choose if fg_root has to be prepended
to the model path.
2002-10-13 10:43:57 +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
david
973ffbf289 Patch from Cameron Moore:
* Fixed (un)signed comparisons
2002-07-18 22:32:50 +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
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
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
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
cd041af9d8 Added a new 'billboard' animation type. This animation takes one
subproperty, 'spherical', which is true if the object has spherical
symmetry and should rotate around both the x-axis and z-axis to face
the camera (i.e. a simple cloud), and false if the object has only
cylindrical symmetry and should rotate only around the z-axis (i.e. a
tree).
2002-05-03 21:09:14 +00:00
david
a8576b9e95 Make an animation with no object name apply to the model as a whole.
This replaces the old "range" subtree with something more general.
2002-04-20 17:07:47 +00:00
david
1094206677 Add support for interpolation tables for non-linear animations.
Remove header dependencies where possible, to speed up rebuilds.
2002-04-20 14:07:34 +00:00
david
e528324955 MSVC fix. 2002-04-13 21:41:51 +00:00
david
d164d565c0 Patch from Norm Vine to speed up model placement.
DPM: untabified file.
2002-04-13 13:30:38 +00:00
david
6b71800829 Add and document a "range" (level-of-detail) animation for individual
objects and a range for the model as a whole.
2002-04-13 12:10:20 +00:00
david
8bed5a8cf4 Added support for additional animated, dynamic 3D models configured in
XML.
2002-04-12 12:45:49 +00:00
curt
f1c03ed957 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
you can expect that the data that viewmgr is writing to the property tree
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:25:30 +00:00
david
50c13f7972 Patch from Jim Wilson:
Made a couple more adjustments, now the function builds the
transformation matrix (sans the translation) directly from the five
inputs.  After realizing that it may be necessary for the new location
class to publish a world up vector, comments were added indicating
which values constitute world up.
2002-04-07 15:04:49 +00:00
david
9d6011aa69 Patch from Jim Wilson to realign model slightly in new model code:
This should fix it.  The problem wasn't the rotations but a difference in
the translations.  Note that this fix also puts the wheels back on top of the
pavement when in external view.
2002-04-05 18:48: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
Renamed from src/Main/model.cxx (Browse further)