preStateSet->setAttribute(new osg::Depth(osg::Depth::LESS, 0.0, 1.0,
false));
pre_root->setStateSet(preStateSet);
- cloud_root = new osg::Group;
+ cloud_root = new osg::Switch;
cloud_root->setNodeMask(simgear::MODEL_BIT);
cloud_root->setName("SGSky-cloud-root");
// initialize the sky and connect the components to the scene graph at
// the provided branch
-void SGSky::build( double h_radius_m, double v_radius_m,
- double sun_size, double moon_size,
- const SGEphemeris& eph, SGPropertyNode *property_tree_node,
+void SGSky::build( double h_radius_m,
+ double v_radius_m,
+ double sun_size,
+ double moon_size,
+ const SGEphemeris& eph,
+ SGPropertyNode *property_tree_node,
simgear::SGReaderWriterOptions* options )
{
dome = new SGSkyDome;
SGSky::add_cloud_layer( SGCloudLayer * layer )
{
cloud_layers.push_back(layer);
- cloud_root->addChild(layer->getNode());
+ cloud_root->addChild(layer->getNode(), true);
layer->set_enable3dClouds(clouds_3d_enabled);
}
SGCloudField::setUseImpostors(imp);
}
-void SGSky::texture_path( const string& path ) {
+void SGSky::texture_path( const std::string& path ) {
tex_path = SGPath( path );
}
effective_visibility = effvis;
}
-
+void SGSky::set_clouds_enabled(bool enabled)
+{
+ if (enabled) {
+ cloud_root->setAllChildrenOn();
+ } else {
+ cloud_root->setAllChildrenOff();
+ }
+}