1 // cloud.hxx -- model a single cloud layer
3 // Written by Curtis Olson, started June 2000.
5 // Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef _SG_CLOUD_HXX_
25 #define _SG_CLOUD_HXX_
30 #include <simgear/misc/fgpath.hxx>
34 SG_CLOUD_OVERCAST = 0,
35 SG_CLOUD_MOSTLY_CLOUDY,
36 SG_CLOUD_MOSTLY_SUNNY,
46 ssgTransform *layer_transform;
47 ssgSimpleState *layer_state;
53 // height above sea level (meters)
55 float layer_thickness;
56 float layer_transition;
60 // for handling texture coordinates to simulate cloud movement
61 // from winds, and to simulate the clouds being tied to ground
62 // position, not view position
64 double last_lon, last_lat;
72 ~SGCloudLayer( void );
74 // build the cloud object
75 void build( FGPath path, double size, double asl, double thickness,
76 double transition, SGCloudType type );
78 // repaint the cloud colors based on current value of sun_angle,
79 // sky, and fog colors. This updates the color arrays for
81 // sun angle in degrees relative to verticle
82 // 0 degrees = high noon
83 // 90 degrees = sun rise/set
84 // 180 degrees = darkest midnight
85 bool repaint( sgVec3 fog_color );
87 // reposition the cloud layer at the specified origin and
89 // lon specifies a rotation about the Z axis
90 // lat specifies a rotation about the new Y axis
91 // spin specifies a rotation about the new Z axis (and orients the
92 // sunrise/set effects
93 bool reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt );
95 // draw the cloud layer
98 inline float get_asl() const { return layer_asl; }
99 inline float get_thickness() const { return layer_thickness; }
100 inline float get_transition() const { return layer_transition; }
104 // make an ssgSimpleState for a cloud layer given the named texture
105 ssgSimpleState *SGCloudMakeState( const string &path );
108 #endif // _SG_CLOUD_HXX_