Introduce TerrainSystem node which decorates a complete terrain model made up of Terrain tiles.

This commit is contained in:
Robert Osfield
2008-03-26 20:06:54 +00:00
parent c9fc0cd802
commit a9d283ca73
12 changed files with 239 additions and 57 deletions

View File

@@ -38,6 +38,8 @@
#include <osgGA/AnimationPathManipulator>
#include <osgGA/TerrainManipulator>
#include <osgTerrain/TerrainSystem>
#include <osgViewer/ViewerEventHandlers>
#include <osgViewer/Viewer>
@@ -196,6 +198,15 @@ int main( int argc, char **argv )
return 1;
}
osgTerrain::TerrainSystem* terrain = findTopMostNodeOfType<osgTerrain::TerrainSystem>(rootnode);
if (!terrain)
{
terrain = new osgTerrain::TerrainSystem;
terrain->addChild(rootnode);
rootnode = terrain;
}
osg::CoordinateSystemNode* csn = findTopMostNodeOfType<osg::CoordinateSystemNode>(rootnode);
unsigned int numLayers = 1;