]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sky/cloud.hxx
Updates to cloud code to add different basic cloud types. This isn't the
[simgear.git] / simgear / sky / cloud.hxx
index 37deac1922e9de2b2e6b26905099c8bdd23cb217..05961c54af56af73f0d14dc36c9ee5d6f1f5e00a 100644 (file)
 #include <simgear/misc/fgpath.hxx>
 
 
+enum SGCloudType {
+    SG_CLOUD_OVERCAST = 0,
+    SG_CLOUD_MOSTLY_CLOUDY,
+    SG_CLOUD_MOSTLY_SUNNY,
+    SG_CLOUD_CIRRUS,
+};
+
+
 class SGCloudLayer {
 
+private:
+
+    ssgRoot *layer_root;
     ssgTransform *layer_transform;
     ssgSimpleState *layer_state;
 
@@ -41,7 +52,10 @@ class SGCloudLayer {
 
     // height above sea level (meters)
     float layer_asl;
+    float layer_thickness;
+    float layer_transition;
     float size;
+    float scale;
 
     // for handling texture coordinates to simulate cloud movement
     // from winds, and to simulate the clouds being tied to ground
@@ -58,7 +72,8 @@ public:
     ~SGCloudLayer( void );
 
     // build the cloud object
-    ssgBranch *build( FGPath path, double size, double asl );
+    void build( FGPath path, double size, double asl, double thickness,
+               double transition, SGCloudType type );
 
     // repaint the cloud colors based on current value of sun_angle,
     // sky, and fog colors.  This updates the color arrays for
@@ -75,8 +90,19 @@ public:
     // lat specifies a rotation about the new Y axis
     // spin specifies a rotation about the new Z axis (and orients the
     // sunrise/set effects
-    bool reposition( sgVec3 p, sgVec3 up, double lon, double lat );
+    bool reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt );
+
+    // draw the cloud layer
+    void draw();
+
+    inline float get_asl() const { return layer_asl; }
+    inline float get_thickness() const { return layer_thickness; }
+    inline float get_transition() const { return layer_transition; }
 };
 
 
+// make an ssgSimpleState for a cloud layer given the named texture
+ssgSimpleState *SGCloudMakeState( const string &path );
+
+
 #endif // _SG_CLOUD_HXX_