#endif
#include <simgear/math/sg_random.h>
+#include <simgear/scene/util/RenderConstants.hxx>
#include "sky.hxx"
#include "cloudfield.hxx"
in_cloud = -1;
pre_root = new osg::Group;
- post_root = new osg::Group;
+ pre_root->setNodeMask(simgear::BACKGROUND_BIT);
cloud_root = new osg::Group;
+ cloud_root->setNodeMask(simgear::BACKGROUND_BIT | simgear::MODEL_BIT);
pre_selector = new osg::Switch;
- post_selector = new osg::Switch;
pre_transform = new osg::MatrixTransform;
- post_transform = new osg::MatrixTransform;
}
pre_selector->addChild( pre_transform.get() );
- post_selector->addChild( post_transform.get() );
-
pre_root->addChild( pre_selector.get() );
- post_root->addChild( post_selector.get() );
}
SGSharedPtr<SGStars> stars;
layer_list_type cloud_layers;
- osg::ref_ptr<osg::Group> pre_root, post_root, cloud_root;
- osg::ref_ptr<osg::Switch> pre_selector, post_selector;
- osg::ref_ptr<osg::MatrixTransform> pre_transform, post_transform;
+ osg::ref_ptr<osg::Group> pre_root, cloud_root;
+ osg::ref_ptr<osg::Switch> pre_selector;
+ osg::ref_ptr<osg::MatrixTransform> pre_transform;
SGPath tex_path;
void modify_vis( float alt, float time_factor );
osg::Node* getPreRoot() { return pre_root.get(); }
- osg::Node* getPostRoot() { return post_root.get(); }
osg::Node* getCloudRoot() { return cloud_root.get(); }
/**
inline void texture_path( const string& path ) {
tex_path = SGPath( path );
}
-
/** Enable drawing of the sky. */
inline void enable() {
pre_selector->setValue(0, 1);
- post_selector->setValue(0, 1);
}
/**
*/
inline void disable() {
pre_selector->setValue(0, 0);
- post_selector->setValue(0, 0);
}
/**
RUNWAYLIGHTS_BIT = (1 << 10),
LIGHTS_BITS = (GROUNDLIGHTS0_BIT | GROUNDLIGHTS1_BIT | GROUNDLIGHTS2_BIT
| RUNWAYLIGHTS_BIT),
- BACKGROUND_BIT = (1 << 11)
+ // Sky parts
+ BACKGROUND_BIT = (1 << 11),
+ // Everything else that isn't terrain. Initially for clouds;
+ // eventually for other models?
+ MODEL_BIT = (1 << 12)
};
// Theory of bin numbering: