]> git.mxchange.org Git - simgear.git/blobdiff - simgear/scene/sky/cloud.hxx
Work around apparent OSG 3.2.0 normal binding bug.
[simgear.git] / simgear / scene / sky / cloud.hxx
index 91a977b02f00d5e99795ac9614b0a1b11c6fb547..95f6dbbedbd879b8c9c19b75ebf5e4610455a71b 100644 (file)
@@ -63,6 +63,13 @@ public:
        SG_MAX_CLOUD_COVERAGES
     };
 
+    static const std::string SG_CLOUD_OVERCAST_STRING; // "overcast"
+    static const std::string SG_CLOUD_BROKEN_STRING; // "broken"
+    static const std::string SG_CLOUD_SCATTERED_STRING; // "scattered"
+    static const std::string SG_CLOUD_FEW_STRING; // "few"
+    static const std::string SG_CLOUD_CIRRUS_STRING; // "cirrus"
+    static const std::string SG_CLOUD_CLEAR_STRING; // "clear"
+
     /**
      * Constructor
      * @param tex_path the path to the set of cloud textures
@@ -101,6 +108,16 @@ public:
      */
     void setThickness_m (float thickness_m);
 
+    /** get the layer visibility */
+    float getVisibility_m() const;
+    /**
+     * set the layer visibility 
+     * @param visibility_m the layer minimum visibility in meters.
+     */
+    void setVisibility_m(float visibility_m);
+
+
+
     /**
      * get the transition/boundary layer depth in meters.  This
      * allows gradual entry/exit from the cloud layer via adjusting
@@ -123,6 +140,18 @@ public:
      */
     void setCoverage (Coverage coverage);
 
+    /** get coverage as string */
+    const string & getCoverageString() const;
+
+    /** get coverage as string */
+    static const string & getCoverageString( Coverage coverage );
+
+    /** get coverage type from string */
+    static Coverage getCoverageType( const std::string & coverage );
+
+    /** set coverage as string */
+    void setCoverageString( const string & coverage );
+
     /**
      * set the cloud movement direction
      * @param dir the cloud movement direction
@@ -155,10 +184,20 @@ public:
      */
     inline void setAlpha( float alpha ) {
         if ( alpha < 0.0 ) { alpha = 0.0; }
-        if ( alpha > 1.0 ) { alpha = 1.0; }
+        if ( alpha > max_alpha ) { alpha = max_alpha; }
         cloud_alpha = alpha;
     }
 
+    inline void setMaxAlpha( float alpha ) {
+        if ( alpha < 0.0 ) { alpha = 0.0; }
+        if ( alpha > 1.0 ) { alpha = 1.0; }
+        max_alpha = alpha;
+    }
+
+    inline float getMaxAlpha() const {
+        return max_alpha;
+    }
+
     /** build the cloud object */
     void rebuild();
 
@@ -188,8 +227,6 @@ public:
 
     osg::Switch* getNode() { return cloud_root.get(); }
 
-    static bool enable_bump_mapping;
-
     /** return the 3D layer cloud associated with this 2D layer */
     SGCloudField *get_layer3D(void) { return layer3D; }
 
@@ -216,6 +253,7 @@ private:
     float layer_asl;
     float layer_thickness;
     float layer_transition;
+    float layer_visibility;
     Coverage layer_coverage;
     float scale;
     float speed;
@@ -227,6 +265,7 @@ private:
     // double xoff, yoff;
     SGGeod last_pos;
     double last_course;
+    double max_alpha;
 
     osg::Vec2 base;