X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fsky%2Fcloud.hxx;h=4d117e143c4154828867c7f457d0882cd26e69ff;hb=f1ab6e2533a1bf07439b3d5918430f496158d8f3;hp=37deac1922e9de2b2e6b26905099c8bdd23cb217;hpb=7db73cd2150b69aa7ae38fa8a46862c8d12231b9;p=simgear.git diff --git a/simgear/sky/cloud.hxx b/simgear/sky/cloud.hxx index 37deac19..4d117e14 100644 --- a/simgear/sky/cloud.hxx +++ b/simgear/sky/cloud.hxx @@ -4,19 +4,20 @@ // // Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License as -// published by the Free Software Foundation; either version 2 of the -// License, or (at your option) any later version. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Library General Public +// License as published by the Free Software Foundation; either +// version 2 of the License, or (at your option) any later version. // -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. +// Library General Public License for more details. // -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +// You should have received a copy of the GNU Library General Public +// License along with this library; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. // // $Id$ @@ -24,14 +25,34 @@ #ifndef _SG_CLOUD_HXX_ #define _SG_CLOUD_HXX_ +#ifdef HAVE_CONFIG_H +# include +#endif + +#include #include -#include +#include STL_STRING +FG_USING_STD(string); + + +#define SG_MAX_CLOUD_TYPES 4 // change this if we add/remove cloud + // types en the enum below + +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 +62,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 +82,8 @@ public: ~SGCloudLayer( void ); // build the cloud object - ssgBranch *build( FGPath path, double size, double asl ); + void build( double size, double asl, double thickness, + double transition, ssgSimpleState *state ); // repaint the cloud colors based on current value of sun_angle, // sky, and fog colors. This updates the color arrays for @@ -75,8 +100,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_