X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fscene%2Fsky%2Fcloud.hxx;h=6a179d9f768719ef2d8d7ac67564d419ad089e3d;hb=68eb7031e2dce999d112d0164fa28d4b8d66922e;hp=73ca832232d2af9e118bf7c130274e3cb5b9adb0;hpb=7fc8c026884b2d0a1b683765c089a9bef5ac47c8;p=simgear.git diff --git a/simgear/scene/sky/cloud.hxx b/simgear/scene/sky/cloud.hxx index 73ca8322..6a179d9f 100644 --- a/simgear/scene/sky/cloud.hxx +++ b/simgear/scene/sky/cloud.hxx @@ -39,6 +39,7 @@ SG_USING_STD(string); // SG_USING_STD(cout); // SG_USING_STD(endl); +class SGCloudField; /** * A class layer to model a single cloud layer @@ -143,6 +144,18 @@ public: /** get the cloud movement speed */ inline float getSpeed() { return speed; } + /** + * set the alpha component of the cloud base color. Normally this + * should be 1.0, but you can set it anywhere in the range of 0.0 + * to 1.0 to fade a cloud layer in or out. + * @param alpha cloud alpha value (0.0 to 1.0) + */ + inline void setAlpha( float alpha ) { + if ( alpha < 0.0 ) { alpha = 0.0; } + if ( alpha > 1.0 ) { alpha = 1.0; } + cloud_alpha = alpha; + } + /** build the cloud object */ void rebuild(); @@ -171,6 +184,9 @@ public: static bool enable_bump_mapping; + /** return the 3D layer cloud associated with this 2D layer */ + SGCloudField *get_layer3D(void) { return layer3D; } + private: struct CloudVertex { @@ -191,6 +207,8 @@ private: ssgLeaf *layer[4]; ssgStateSelector *state_sel; + float cloud_alpha; // 1.0 = drawn fully, 0.0 faded out completely + ssgColourArray *cl[4]; ssgVertexArray *vl[4]; ssgTexCoordArray *tl[4]; @@ -211,6 +229,8 @@ private: // position, not view position // double xoff, yoff; double last_lon, last_lat, last_course; + + SGCloudField *layer3D; };