James Turner [Wed, 7 Nov 2012 21:10:00 +0000 (21:10 +0000)]
Test for, and fix, materials handling in BTG code.
It's possible (and happens!) to have less than 2^16 vertices or tex-coords, but more than 2^15 objects (tris) with the same materials. This was breaking our version 7 vs version 10 detection logic. Pete found the issue, I'm simply committing a version of his fix.
ThorstenB [Tue, 6 Nov 2012 23:53:32 +0000 (00:53 +0100)]
Fix property find_last_child/addChild.
Initial "addChild" should have index #0 (not #1).
Also extend test cases.
(Test case shows addChild(append=false) isn't working as expected!?)
Thomas Geymayer [Mon, 5 Nov 2012 16:58:24 +0000 (17:58 +0100)]
Move parseColor to scene/util
parseColor is used to parse a CSS color string into an osg::Vec4
which is only available in SimGearScene. If someone needs the
function also in SimGear headless mode we have to think about
where to better place this function.
Thomas Geymayer [Sun, 4 Nov 2012 13:12:05 +0000 (14:12 +0100)]
Refactor Canvas and add some helpers.
- Refactor Canvas from FlightGear and fix lazy rendering with
recursive canvases.
- New classes PropertyBasedElement and PropertyBasedManager for
creating subsystems controlled by the property tree.
- New method parseColor to parse CSS 3 conformant color strings
(only basic color schemes supported)
- New Rect class representing a rectangle.
Thomas Geymayer [Mon, 29 Oct 2012 15:10:10 +0000 (16:10 +0100)]
Helper for property controlled subsystems
- Subsystem which manages a list of elements which
are controlled through the property tree.
- Fix a ShivaVG compiler warning.
- Add some helper functions to trigger property removed/add
events for a whole property tree.
ThorstenB [Sat, 13 Oct 2012 10:29:04 +0000 (12:29 +0200)]
Avoid randomness when processing directories.
Order of files in file system order is random (maybe different for every
user). Determinsm is good, i.e. when loading Nasal scripts in a fixed,
known sequence, or config files, where the later may overrule settings of
the earlier.
Stuart Buchanan [Wed, 10 Oct 2012 18:57:16 +0000 (19:57 +0100)]
Change default tree-max-density-angle-deg to 30 and tree-zero-density-angle-deg to 45, as redommended by Thorsten Renk to account for our scenery generally rendering slopes shallower than they are IRL.
Flatten the leaf nodes in the paged bounding volume tree
as good as possible. The implementation still assumes a
whole world database which actually holds for our usual
scenery.
This kind of work is done two times for different
flavours of bounding volume generation. Factor
out and use this in BVHPageNodeOSG.cxx and
BoundingVolumeBuildVisitor.hxx.
James Turner [Sun, 23 Sep 2012 23:02:11 +0000 (00:02 +0100)]
SGTime: use SGGeod, quieter init.
It's common to use SGTime to calculate the the Julian Date, without providing time-zone information. Don't warn in these cases, since the behaviour is fine.
James Turner [Tue, 18 Sep 2012 19:26:28 +0000 (20:26 +0100)]
Support for incremental init of subsystems.
Allow subsystem init to be incremental, i.e requiring repeated init calls until a 'done' code is returned. Use this to support incremental init in groups and the manager. (It would also be possible to support it in an individual subsystem).
Note that if you use the existing init() calls, behaviour is unchanged.
James Turner [Sun, 16 Sep 2012 16:07:35 +0000 (17:07 +0100)]
Option to use system, instead of built-in, expat
At least one Linux distribution packager of FG has complained that we're bundling expat in our binaries. To keep them happy, add the option (-DSYSTEM_EXPAT=1 at cmake time) to use the system expat instead.
For the moment (and simplicity), this requires building SIMGEAR_SHARED (which is fired to on by selecting the option).
James Turner [Sun, 16 Sep 2012 15:34:10 +0000 (16:34 +0100)]
De-virtualise SGSky to avoid a clang warning.
Clang was complaining that SGSky has virtual methods, but no virtual destructor. It turns out we're never subclassing SGSky - it's used directly. Hence, remove all the 'virtual' attributes from its methods.
James Turner [Sun, 16 Sep 2012 15:27:22 +0000 (16:27 +0100)]
Kill off MIPS compatibility header.
CMake has never supported the MIPS compatibility headers, or indeed building using MIPSpro. If someone wishes to re-add MIPS/IRIX support, I'm hoping they will be using a compiler with functional standard library headers!
James Turner [Sun, 16 Sep 2012 15:25:11 +0000 (16:25 +0100)]
Add an SG_UNUSED macro to SimGear.
Imitate Q_UNSUED from Qt, and provide a Simgear 'unused var' warning suppression macro. Fix up one place where the previous warning suppression attempt (assigning to self) was still producing a warning under clang.
James Turner [Sun, 16 Sep 2012 15:04:08 +0000 (16:04 +0100)]
Standardise SimGear libraries, for static vs shared.
Always create only two SimGear libraries: SimGearCore and SimGearStatic, regardless of whether we're building static or shared. This requires an updated to FindSimGear.cmake module, for the static configuration.
Scene: use better clipping mode for material textures.
This eliminates the black borders on runways between threshold and
designation textures and also between two designation numbers.
Fix libsvn detection for some Linux distros
Distros like Debian/Ubuntu use architecture-specific directory structures
(like /usr/lib/x86_64-linux-gnu) which we cannot hardcode/guess, so we
really need to search the default paths.
scenery: OptionsReadFileCallback for use with reader writer options.
The new callback has a default implementation of the callback
methods that do call back into the registrys callback before
calling the registrys implementation directly.
This is meant to be used together with ReaderWriterOptions that
still want to call back into the normal callback chain of the
registry.
stg: Add flag to load only specific parts of the stg files.
The flags are meant to be used for fgelev and for an ai
module that will probably only need ground elevation queries
in those reagions where the aircraft simulated there will roll
that is on airports.
bvh: Move the basic bounding volume tree functionality into core.
The basic boundignvolume implementation does only need math and
geometry. As such it is agnostic to the scenegraph being used.
Only the parts building this query structure from terrain
depend on the implementation of the terrain.
So, move this into the simgear core component.