Ignore:
Timestamp:
Jan 31, 2015, 11:27:43 PM (10 years ago)
Author:
ldelgass
Message:

First pass at protocol to set ephemeris time (currently uses server local time)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/Renderer.cpp

    r4957 r4973  
    736736        skyOpts.atmosphericLighting() = true;
    737737        skyOpts.exposure() = 3.0;
    738         osgEarth::Util::SkyNode *sky = osgEarth::Util::SkyNode::create(skyOpts, mapNode);
    739         sky->addChild(mapNode);
    740         sky->attach(_viewer.get(), 0);
    741         _sceneRoot = sky;
     738        _skyNode = osgEarth::Util::SkyNode::create(skyOpts, mapNode);
     739        _skyNode->addChild(mapNode);
     740        _skyNode->attach(_viewer.get(), 0);
     741        _sceneRoot = _skyNode;
    742742#else
    743743        _sceneRoot = new osg::Group();
     
    745745
    746746        TRACE("Creating SkyNode");
    747         osgEarth::Util::SkyNode *sky = new osgEarth::Util::SkyNode(map);
    748         _sceneRoot->addChild(sky);
    749         sky->setAmbientBrightness(0.2f);
    750         sky->setDateTime(now);
    751         sky->attach(_viewer.get(), 0);
     747        _skyNode = new osgEarth::Util::SkyNode(map);
     748        _sceneRoot->addChild(_skyNode.get());
     749        _skyNode->setAmbientBrightness(0.2f);
     750        _skyNode->setDateTime(now);
     751        _skyNode->attach(_viewer.get(), 0);
    752752#endif
    753753    } else {
     
    811811        }
    812812        _verticalScale->setScale(scale);
     813        _needsRedraw = true;
     814    }
     815}
     816
     817void Renderer::setEphemerisTime(int year, int month, int day, double hours)
     818{
     819    if (_skyNode.valid()) {
     820        osgEarth::DateTime time(year, month, day, hours);
     821        _skyNode->setDateTime(time);
    813822        _needsRedraw = true;
    814823    }
Note: See TracChangeset for help on using the changeset viewer.