timoore [Tue, 4 Mar 2008 08:58:33 +0000 (08:58 +0000)]
cleanup of precipitation contribution
Reindent everything to Stroustrup style and make member variable style
consistent.
Remove unused header files.
SGPrecipitation is now a subclass of osg::Referenced.
Initialize snow and ice intensity to 0 directly. The methods that set
the intensities change the value slowly and so don't work when the
initial value is garbage.
timoore [Sat, 2 Feb 2008 23:01:27 +0000 (23:01 +0000)]
Cleanup and performance tuning of the random trees code.
The QuadTreeBuilder class was completely revamped as a templated class
to support flexible creation of scene graph quad trees, and a major
bug was fixed as well. Now it actually generates quadtrees instead of
some weird striped thing.
One StateSet is shared among all the "forests." The trees are drawn
after normal terrain objects to minimize some of the transparency
related artifacts.
Lighting was implemented in the ShaderGeometry shader (for both
polygon sides). Ambient-diffuse values for trees are hard-coded in
TreeBin.cxx.
DotOsg wrappers were added for ShaderGeometry so it can be output in
the scene graph dump.
frohlich [Wed, 26 Dec 2007 19:10:40 +0000 (19:10 +0000)]
Modified Files:
Makefile.am
Added Files:
SGExpression.cxx SGExpression.hxx: Add not yet complete but already
usable expression tree. Will be used with the panel code.
frohlich [Wed, 26 Dec 2007 19:05:06 +0000 (19:05 +0000)]
Modified Files:
Makefile.am
Added Files:
SGClipGroup.cxx SGClipGroup.hxx: Add helper group node for reuse
of clipping planes. Will be used for the panel code.
timoore [Thu, 13 Dec 2007 23:30:24 +0000 (23:30 +0000)]
Use node masks and shared state sets to manage ground lights
Do away with the switch in each terrain tile for the ground lights. They are
turned on by node masks now.
Share state sets among all the light nodes and manage the fog values through a
"GroundLightManager" instead of having separate state sets and callback
functions for each group in each tile.
timoore [Tue, 11 Dec 2007 11:07:21 +0000 (11:07 +0000)]
minor fix to ModelRegistry and syntax changes for Windows
Create the local path in the right order in OptionsPusher. When
OptionsPusher is used, put it inside a new code block so the order of
destruction with respect to the mutex on reader functions id clear.
Add #include <algorithm> to top of ModelRegistry.cxx.
timoore [Sun, 9 Dec 2007 22:38:10 +0000 (22:38 +0000)]
Work around osg Registry path list problems
The OSG reader plugins overwrite the path list passed in options with the local
directory of the file being read, forcing you to set the path list in
the Registry. I think this a bug, but in the meantime here's a workaround.
timoore [Thu, 29 Nov 2007 23:56:31 +0000 (23:56 +0000)]
Avoid copying drawables and dirtying display lists.
For the alpha-test animation, use an OVERRIDE attribute on the state
set of the top level node instead of copying drawables and state sets
throughout the model.
As a temporary hack in the blend animation, don't use display lists in
the cloned drawables.
These changes are aimed at cutting down the number of display lists
that the pager needs to compile.
timoore [Thu, 29 Nov 2007 23:56:09 +0000 (23:56 +0000)]
rewrite ModelRegistry callbacks as a template with pluggable policy classes
In a big effort to improve use of the object cache, provide a
ModelRegistryCallback template class with different policies for
substitution, caching, optimization, etc.
Change SGTexDataVarianceVistor to make StateSets static too.
timoore [Thu, 29 Nov 2007 23:55:01 +0000 (23:55 +0000)]
Move SGReadFileCallback from model.cxx to public class ModelRegistry
Move SGReadFileCallback and all its help classes into a new
ModelRegistry class that also provides an interface to add custom
callbacks for specific file extensions. SGReaderWriterBTG uses that to
keep any further processing from being done on .btg files. Various
namespace-releated cleanup was done on this code too.
durk [Sat, 17 Nov 2007 09:16:58 +0000 (09:16 +0000)]
Refined debug timing control:
- Added a SampleStatistic class (from the old deprecated libg++) library.
- Make time statistics and printing conditionable
- Added an interface function to switch time stamp collection and printing
on and off from the application (defaults to off).
curt [Mon, 5 Nov 2007 21:42:29 +0000 (21:42 +0000)]
In the original flightgear native/binary scenery terrain data format, we
used short's extensively to represent counts of objects (number of points,
number of texture coordinates, number of traingle strips, etc.) and we used
shorts to index into larger structures. But this capped many of our structure
sizes to a maximum of 32768.
By switching to unsigned shorts in the future, we can double the maximum
object/index counts without losing anything. This was a pretty major
oversight in our original specification.
I have bumped up the native object file version from 6 to 7 and added code
in the reader to maintain full backwards compatibilty with version 6
scenery files (i.e. the current 0.9.10 scenery release.)
durk [Mon, 15 Oct 2007 18:49:50 +0000 (18:49 +0000)]
- A few fixes to ensure SimGear compiles again on cygwin.
* on cygwin, isnan is declared in ieeepf.h
* CYGWIN is a special case in that it is windows based, but sometimes
folows unix conventions. SGAtomic compilation failed on an illegal
volatile type cast without the additional __CYGWIN__ define check.
timoore [Thu, 4 Oct 2007 20:53:22 +0000 (20:53 +0000)]
Don't reset the random texture base when rebuilding a cloud layer
This fix removes obnoxious visuals (texture jumping) when a cloud
layer is moved due to a metar update or, more significantly, when
switching from metar to a scenario. Also, I switched to using a TexMat
to displace the cloud texture in order to avoid writing the texture
array every frame.
Put the ocean tile state set in osg::Geometry, not the osg::Geode, so that
is readily available during intersection testing and can be used to find the
corresponding SGMaterial.
Fix material animations with only a <texture-prop>
On 8/31/07, K. Hoercher <wbhoer@gmail.com> wrote:
> > Some notes:
> > - I found that in order to make the example from model-howto.html work
> > ( starting at "To make a texture replaceable at runtime") one has to
> > specify a valid (i.e. loadable) <texture> in the material animation.
The cause seems to be the condition in SGMaterialAnimation.cxx l.277
ignoring any texture update by the UpdateCallback (only there
<texture-prop> is looked at) without an already existing stateSet.
That in turn will not be created with a <texture-prop> alone l. 379ff.
Unless I overlooked some compelling reason contradicting, I'd like to
suggest allowing for a stateSet to be created for those situations
too. I think that would match the behaviour of animation.cxx
(PRE_OSG_PLIB_20061029) and is imho the more expected and also
documented one.
Documentation fixes: Updated the contents of README.plib and README.OpenAL
Also make sure that these files are included in the release. This is
required, since ./configure refers to these files.
frohlich [Tue, 7 Aug 2007 05:26:21 +0000 (05:26 +0000)]
Modified Files:
projects/VC7.1/SimGear.vcproj projects/VC8/SimGear.vcproj
simgear/math/Makefile.am simgear/math/SGGeoc.hxx
simgear/math/SGGeodesy.cxx simgear/math/SGGeodesy.hxx
simgear/math/polar3d.hxx simgear/math/sg_geodesy.hxx
simgear/math/sg_types.hxx
Removed Files:
simgear/math/polar3d.cxx simgear/math/sg_geodesy.cxx
simgear/math/sg_memory.h:
Remove sg_memory.h It is unused anyway and should not be required
in a c++ world. Move distance course functions to the SG* type
system. Move the implementation into SGGeodesy.cxx. Remove some of
the old Point3D Based sg* functions that are already unused.
Remove an extern SGSky *thesky reference that isn't used in the code anyway.
The original code forced a dependency in SimGear back to something that is
defined globaly in FlightGear, not a great strategy for a library with some
"general purpose" intentions.
Maik JUSTUS: workaround for broken Doppler effect in OpenAL
mf: this patch is meant to be removed as soon as OpenAL got fixed. (The
OpenAL developers acknowleged the bug and announced that it'll get
fixed.) For removal try
$ cd simgear/sound
$ cvs diff -rAFTER_OPENAL_DOPPLER_WORKAROUND -rBEFORE_OPENAL_DOPPLER_WORKAROUND|patch