Skip to content

Commit

Permalink
[globe] Fix clipping problems when close to the ground
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 28, 2013
1 parent 4ad4bdf commit e6d1093
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/plugins/globe/globe_plugin.cpp
Expand Up @@ -60,6 +60,7 @@
#include <osgEarthUtil/AutoClipPlaneHandler>
#include <osgEarthDrivers/gdal/GDALOptions>
#include <osgEarthDrivers/tms/TMSOptions>
#include <osgEarth/Version>

using namespace osgEarth::Drivers;
using namespace osgEarth::Util;
Expand Down Expand Up @@ -287,8 +288,13 @@ void GlobePlugin::run()
mOsgViewer->addEventHandler( new osgViewer::ThreadingHandler() );
mOsgViewer->addEventHandler( new osgViewer::LODScaleHandler() );
mOsgViewer->addEventHandler( new osgGA::StateSetManipulator( mOsgViewer->getCamera()->getOrCreateStateSet() ) );
#if OSGEARTH_VERSION_LESS_THAN( 2, 2, 0 )
// add a handler that will automatically calculate good clipping planes
//mOsgViewer->addEventHandler( new osgEarth::Util::AutoClipPlaneHandler() );
mOsgViewer->addEventHandler( new osgEarth::Util::AutoClipPlaneHandler() );
#else
mOsgViewer->getCamera()->addCullCallback( new AutoClipPlaneCullCallback( mMapNode ) );
#endif

// osgEarth benefits from pre-compilation of GL objects in the pager. In newer versions of
// OSG, this activates OSG's IncrementalCompileOpeartion in order to avoid frame breaks.
mOsgViewer->getDatabasePager()->setDoPreCompile( true );
Expand Down

0 comments on commit e6d1093

Please sign in to comment.