#include "cloud.hxx"
ssgSimpleState *
-SGCloudLayer::layer_states[SGCloudLayer::SG_MAX_CLOUD_TYPES];
+SGCloudLayer::layer_states[SGCloudLayer::SG_MAX_CLOUD_COVERAGES];
// Constructor
layer_asl(0.0),
layer_thickness(0.0),
layer_transition(0.0),
- layer_type(SG_CLOUD_CLEAR),
+ layer_coverage(SG_CLOUD_CLEAR),
scale(4000.0),
last_lon(0.0),
last_lat(0.0)
{
- for ( int i = 0; i < SG_MAX_CLOUD_TYPES; ++i ) {
+ for ( int i = 0; i < SG_MAX_CLOUD_COVERAGES; ++i ) {
layer_states[i] = NULL;
}
layer_root->addKid(layer_transform);
layer_transition = transition_m;
}
-SGCloudLayer::Type
-SGCloudLayer::getType () const
+SGCloudLayer::Coverage
+SGCloudLayer::getCoverage () const
{
- return layer_type;
+ return layer_coverage;
}
void
-SGCloudLayer::setType (Type type)
+SGCloudLayer::setCoverage (Coverage coverage)
{
- if (type != layer_type) {
- layer_type = type;
+ if (coverage != layer_coverage) {
+ layer_coverage = coverage;
rebuild();
}
}
layer_states[SG_CLOUD_OVERCAST] = SGCloudMakeState(cloud_path.str());
cloud_path.set(texture_path.str());
- cloud_path.append("mostlycloudy.rgba");
- layer_states[SG_CLOUD_MOSTLY_CLOUDY]
+ cloud_path.append("broken.rgba");
+ layer_states[SG_CLOUD_BROKEN]
= SGCloudMakeState(cloud_path.str());
cloud_path.set(texture_path.str());
- cloud_path.append("mostlysunny.rgba");
- layer_states[SG_CLOUD_MOSTLY_SUNNY]
+ cloud_path.append("scattered.rgba");
+ layer_states[SG_CLOUD_SCATTERED]
+ = SGCloudMakeState(cloud_path.str());
+
+ cloud_path.set(texture_path.str());
+ cloud_path.append("few.rgba");
+ layer_states[SG_CLOUD_FEW]
= SGCloudMakeState(cloud_path.str());
cloud_path.set(texture_path.str());
cloud_path.append("cirrus.rgba");
- layer_states[SG_CLOUD_CIRRUS] = SGCloudMakeState(cloud_path.str());
+ layer_states[SG_CLOUD_CIRRUS]
+ = SGCloudMakeState(cloud_path.str());
layer_states[SG_CLOUD_CLEAR] = 0;
}
layer = new ssgVtxTable ( GL_TRIANGLE_STRIP, vl, NULL, tl, cl );
layer_transform->addKid( layer );
- if ( layer_states[layer_type] != NULL ) {
- layer->setState( layer_states[layer_type] );
+ if ( layer_states[layer_coverage] != NULL ) {
+ layer->setState( layer_states[layer_coverage] );
}
// force a repaint of the sky colors with arbitrary defaults
void SGCloudLayer::draw() {
- if ( layer_type != SG_CLOUD_CLEAR ) {
+ if ( layer_coverage != SG_CLOUD_CLEAR ) {
ssgCullAndDraw( layer_root );
}
}
public:
- enum Type {
+ enum Coverage {
SG_CLOUD_OVERCAST = 0,
- SG_CLOUD_MOSTLY_CLOUDY,
- SG_CLOUD_MOSTLY_SUNNY,
+ SG_CLOUD_BROKEN,
+ SG_CLOUD_SCATTERED,
+ SG_CLOUD_FEW,
SG_CLOUD_CIRRUS,
SG_CLOUD_CLEAR,
- SG_MAX_CLOUD_TYPES
+ SG_MAX_CLOUD_COVERAGES
};
// Constructors
float getTransition_m () const;
void setTransition_m (float transition_m);
- Type getType () const;
- void setType (Type type);
+ Coverage getCoverage () const;
+ void setCoverage (Coverage coverage);
// build the cloud object
void rebuild();
private:
- static ssgSimpleState *layer_states[SG_MAX_CLOUD_TYPES];
- static int layer_sizes[SG_MAX_CLOUD_TYPES];
+ static ssgSimpleState *layer_states[SG_MAX_CLOUD_COVERAGES];
+ static int layer_sizes[SG_MAX_CLOUD_COVERAGES];
ssgRoot *layer_root;
ssgTransform *layer_transform;
float layer_asl;
float layer_thickness;
float layer_transition;
- Type layer_type;
+ Coverage layer_coverage;
float scale;
// for handling texture coordinates to simulate cloud movement