Skip to content
Permalink
Browse files

[globe] Fix clipping problems when close to the ground

  • Loading branch information
m-kuhn committed Oct 28, 2013
1 parent 4ad4bdf commit e6d10933868c47324a233397879a1d13c0be2210
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/plugins/globe/globe_plugin.cpp
@@ -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;
@@ -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 );

0 comments on commit e6d1093

Please sign in to comment.
You can’t perform that action at this time.