#include <simgear/math/SGMath.hxx>
#include <simgear/structure/SGReferenced.hxx>
-#include STL_STRING
-SG_USING_STD(string);
+#include <string>
+using std::string;
#include <osg/ref_ptr>
#include <osg/Array>
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
*/
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
/** build the cloud object */
void rebuild();
+ /** Enable/disable 3D clouds in this layer */
+ void set_enable3dClouds(bool enable);
+
/**
* repaint the cloud colors based on the specified fog_color
* @param fog_color the fog color
double lon, double lat, double alt,
double dt = 0.0 );
- osg::Switch* getNode() { return layer_root.get(); }
+ 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; }
+protected:
+ void setTextureOffset(const osg::Vec2& offset);
private:
+ osg::ref_ptr<osg::Switch> cloud_root;
osg::ref_ptr<osg::Switch> layer_root;
osg::ref_ptr<osg::Group> group_top, group_bottom;
osg::ref_ptr<osg::MatrixTransform> layer_transform;
// from winds, and to simulate the clouds being tied to ground
// position, not view position
// double xoff, yoff;
- double last_lon, last_lat, last_course;
+ SGGeod last_pos;
+ double last_course;
osg::Vec2 base;
SGCloudField *layer3D;
+
};
#endif // _SG_CLOUD_HXX_