1
0
Fork 0
Commit graph

159 commits

Author SHA1 Message Date
david
4cb99e05ad Patch from Dave Luff:
Your 3D models cause a stackdump when the base is separate from the
root.  I've attached a patched newmat.cxx - you may want to test it
before committing!
2002-07-31 18:44:30 +00:00
david
a5f251a5de Patch from Erik Hofman:
I changed the code such that textures terrain also takes ambient,
diffuse, specular and emissive from the materials.xml file.

[note from dpm: doesn't seem to work yet]
2002-07-31 17:57:59 +00:00
david
43d89cb8d6 Create a top-level branch in each tile for random objects with the
name "random-objects".

Put the random objects for each tile inside a top-level
ssgRangeSelector with a maximum range of 20km.  This saves a lot of
range tests for distant tiles, and gives about a 10% framerate boost
on my card at 1000ft AGL (possibly more on faster cards).
2002-07-27 14:29:57 +00:00
curt
f1eddc9bf4 No need to additionally ref() subcomponents of a tree. Only the root node
needs to be ref()'d.
2002-07-26 23:27:53 +00:00
david
f05e8f95e2 Some renaming, since there wasn't really a tile-level LOD. 2002-07-26 22:12:29 +00:00
david
8244b210fa Give up on the idea of using a singleton dummy bounding sphere;
instead, use a separate dummy bounding sphere for each triangle and
each tile, with the actual bounds, to make sure that objects are
always added when they should be in sight.
2002-07-26 19:06:29 +00:00
david
c33c58476e Load models before counting them. 2002-07-26 19:04:40 +00:00
curt
94b6d4fed5 Oops, remove some unwanted debugging output. 2002-07-26 17:00:18 +00:00
curt
8c7fe4c328 Fixed some signed vs. unsigned warnings. 2002-07-26 16:54:40 +00:00
david
d86a513997 Fix random seeds to avoid coincident objects but still ensure
consistency.
2002-07-25 20:30:51 +00:00
david
e7e576055f Added a new range-selector layer above each tile. That way, by
default, each tile has only 3 extra SSG nodes unless it falls into
range.
2002-07-25 17:32:31 +00:00
david
140774b1e2 Renamed /sim/rendering/dynamic-objects to
/sim/rendering/random-objects, and changed the default from false to true.
2002-07-20 23:11:27 +00:00
david
3f174a15cd Added more documentation. 2002-07-20 23:10:42 +00:00
david
ab91bbe17a More efficient version of get_bounding_radius from Norm Vine. 2002-07-20 19:23:44 +00:00
david
d6f9038a25 Enforce a sane minimum of 1000m for coverage, to avoid run-away object
placement.
2002-07-20 18:41:17 +00:00
david
29268401b2 Randomly-place object overhaul and enhancements
-----------------------------------------------

Fixed a segfault on exit.

Changed the radius of the dummy bounding sphere from 10m to 1000m to
ensure that FOV culling doesn't leave anything out.

Allow an object to have more than one variant model, which will be
chosen randomly.  Simply repeat the <path>...</path> property.

Removed the <billboard> property and replaced it with <heading-type>,
which can be set to "fixed" (leave the model oriented as it is),
"random" (give the model a random heading between 0 and 359 deg), or
"billboard" (always turn the model to face the camera).  The default
is "fixed".  Models look much better when they are not all facing the
same direction.

Allow the user to group models with the same visual range, so that
there can be *many* fewer nodes in the scene graph when the models are
not visible.  This causes an XML-format change, so that instead of

  <object>
   <range-m>...</range-m>
   ...
  </object>
  <object>
   <range-m>...</range-m>
   ...
  </object>
  ...

we now have

  <object-group>
   <range-m>...</range-m>
   <object>
    ...
   </object>
   <object>
    ...
   </object>
   ...
  </object-group>

Every object in a group can still have its own model(s), coverage, and
heading-type, but they all share the same range selector.

This change should already help users with tight memory constraints,
but it will matter much more when we add more object types -- for
example, we can now add dozens of different urban building types
without bloating the scene graph or slowing down the LOD tests for
tris that are out of range (i.e. most of them).
2002-07-20 14:56:37 +00:00
david
cecedd302b Moved object information into a new subclass of FGNewMat, and changed
the property name from coverage to coverage_m2.
2002-07-20 01:51:27 +00:00
david
c814eb3a1e Make objects appear more smoothly and reliably. 2002-07-18 19:16:47 +00:00
david
4ab343569f More efficient rotation matrix calc from Norm Vine. 2002-07-18 15:54:21 +00:00
david
f4cfe4c207 Significant speedup for randomly-placed objects, by taking better
advantage of ssg Frustum culling.
2002-07-18 13:23:29 +00:00
david
f7a17c9020 Modifed random-object code for more memory efficiency:
1. Only one copy of each object (and its texture) is stored in memory,
   no matter how many materials use it.

2. Random objects are added to a triangle only when the objects are in
   range, and they are deleted as soon as the objects are out of
   range.  That way, only a relatively small number of ssg nodes are
   used at any one time.

This patch seems to eliminate freezes when tiles are freed.  There are
occasional stutters at extremely high speeds (i.e. over 3,000kt), but
it seems smooth enough for normal aviation speeds.
2002-07-18 01:04:08 +00:00
david
cc8567ad63 More functional decomposition and documentation. 2002-07-17 22:11:13 +00:00
david
5d2c640f1a Fix some minor inconsistencies and inefficiencies:
- no extra nodes are created at all if the material has no random
  objects defined

- the range selector is place correctly under the transformation

- there is only one range selector for each object type in each
  triangle (experimental -- doesn't seem to make a difference in speed
  or memory)

This patch removes Curt's patch that randomized ranges slightly, since
individual random objects no longer have their own range selectors.
It also leaves the object-group-range value unused, for now.
2002-07-17 21:00:54 +00:00
david
f71f4cf9ab Started functional decomposition for dynamic objects.
Fixed typo in last patch, where objects were using object_group_lod
rather than object_lod.
2002-07-16 23:39:53 +00:00
curt
8dc38a5198 put a separate LOD node in front of ever random object so we can randomize
the exact pop in location of each object ... this allows us to put some objects further out and perhaps hide the popping just a tiny bit?
2002-07-16 20:43:40 +00:00
david
84fcb479f6 Added support for dynamically-generated scenery objects. Set the
property /sim/rendering/dynamic-objects to true to enable them.
2002-07-15 18:16:20 +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
curt
cf146a7d1b Fix a couple "make dist" problems that crept in since the last release.
Regengerate msvc project files.
2002-04-21 05:51:37 +00:00
david
5b2df63f54 Patches from Melchior Franz:
The first hunk might not be necessary, but the light_coverage property
was the only one that wasn't explicitly defaulted, which is unfair.  ;-)
   The second hunk adds the missing initialization to the init routine.
This is necessary, because (unlike the material entries from material.xml)
the generated light entries don't get the light coverage set. Yet
obj.cxx:795 reads this information out fot every leaf, although not needed
in the case of lights. Avoiding this isn't worth the trouble.
   The last hunk sets the missing normal_index. The POINTS branch in
gen_leaf was always called with this int_list empty, which made the normals
handling use data garbage.
2002-03-26 16:10:53 +00:00
david
f65f1800c7 Use !strcmp for all property name comparisons. 2002-03-20 22:23:10 +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
curt
3bf7269174 Initial revision. Things are just beginning to be stubbed in now. 2002-03-17 00:37:22 +00:00
curt
ac99a82b98 Replaced some debugging structure David inadvertantly removed. 2002-03-16 05:12:26 +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
curt
0a01e563f4 Better support of the newer more flexible object file format. This
includes the ability to specify per vertex normals rather than depending
the normals list being the same as the vertices list.  (Support for
previous binary file format scenery is maintained.)
2002-03-13 06:03:37 +00:00
curt
9ff8951be6 *** empty log message *** 2002-03-12 05:37:55 +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
7d8af6fee2 Fix a compiler warning. 2002-03-04 19:59:50 +00:00
curt
73b92a697d Further restructuring of the scenery loading code. 2002-03-03 23:20:55 +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
3966e02de0 A few of Norman's changes I managed to get in.
Added support for arrays of points (in addition to various forms of triangles)
2002-02-28 00:10:35 +00:00
curt
4f67824f09 - Removed redundant FG*:: qualifications from class members
- Fixed comparisons between signed and unsigned ints
2002-02-15 22:00:49 +00:00
curt
dea7284cc7 Restructured the 'freeze' property a bit. We now have
/sim/freeze/master      (implimented)
  /sim/freeze/fuel        (implimented)
  /sim/freeze/position    (not implimented)
  /sim/freeze/time-of-day (not implimented)

/sim/freeze/master is bound to the 'p' key via keyboard.xml, however,
/sim/freeze/fuel is not bound to anything at the moment so you must
change it via the external property interface, or specify an initial
value on the command line.
2002-01-20 03:52:36 +00:00
curt
1fd3d5aa48 Removed old remnants of plib-1.2.x support. We haven't officially supported
this older version of plib in some time, but there were bits of code remaining
that was (or could potentially) cause confusion.
2002-01-11 22:16:05 +00:00
david
73f5eec1b7 ANSI C++ fixes, to allow compilation with g++ 3.x. 2002-01-10 12:52:39 +00:00
david
35056ddaea Removed unused alpha variable; more code cleanups and documentation. 2001-12-30 03:04:39 +00:00
david
a2be88ad74 Initialization fixes. 2001-12-29 13:19:09 +00:00