52
52
#include < osgEarth/Map>
53
53
#include < osgEarth/MapNode>
54
54
#include < osgEarth/TileSource>
55
+ #include < osgEarthUtil/SkyNode>
55
56
#include < osgEarthUtil/AutoClipPlaneHandler>
56
57
#include < osgEarthDrivers/gdal/GDALOptions>
57
58
#include < osgEarthDrivers/tms/TMSOptions>
58
59
59
60
using namespace osgEarth ::Drivers;
60
61
using namespace osgEarth ::Util::Controls21;
62
+ using namespace osgEarth ::Util;
61
63
62
64
#define MOVE_OFFSET 0.05
63
65
@@ -231,9 +233,9 @@ void GlobePlugin::run()
231
233
mIsGlobeRunning = true ;
232
234
setupProxy ();
233
235
234
- if ( getenv ( " MAPXML " ) )
236
+ if ( getenv ( " GLOBE_MAPXML " ) )
235
237
{
236
- char * mapxml = getenv ( " MAPXML " );
238
+ char * mapxml = getenv ( " GLOBE_MAPXML " );
237
239
QgsDebugMsg ( mapxml );
238
240
osg::Node* node = osgDB::readNodeFile ( mapxml );
239
241
if ( !node )
@@ -250,6 +252,14 @@ void GlobePlugin::run()
250
252
setupMap ();
251
253
}
252
254
255
+ if ( getenv ( " GLOBE_SKY" ) ) {
256
+ SkyNode* sky = new SkyNode ( mMapNode ->getMap () );
257
+ sky->setDateTime ( 2011 , 1 , 6 , 17.0 );
258
+ // sky->setSunPosition( osg::Vec3(0,-1,0) );
259
+ sky->attach ( mOsgViewer );
260
+ mRootNode ->addChild ( sky );
261
+ }
262
+
253
263
// create a surface to house the controls
254
264
mControlCanvas = ControlCanvas::get ( mOsgViewer );
255
265
mRootNode ->addChild ( mControlCanvas );
0 commit comments