Skip to content

Commit

Permalink
Examples: make sure ocean goes under the sky
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Aug 21, 2014
1 parent c9d6d22 commit b2790f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/osgEarthUtil/ExampleResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,10 @@ MapNodeHelper::parse(MapNode* mapNode,
OceanNode* ocean = OceanNode::create(OceanOptions(oceanConf), mapNode);
if ( ocean )
{
root->addChild( ocean );
// if there's a sky, we want to ocean under it
osg::Group* parent = osgEarth::findTopMostNodeOfType<SkyNode>(root);
if ( !parent ) parent = root;
parent->addChild( ocean );

Control* c = OceanControlFactory().create(ocean);
if ( c )
Expand Down

0 comments on commit b2790f0

Please sign in to comment.