1 // a layer of 3d clouds
3 // Written by Harald JOHNSEN, started April 2005.
5 // Copyright (C) 2005 Harald JOHNSEN - hjohnsen@evc.net
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, 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
23 #ifndef _CLOUDFIELD_HXX
24 #define _CLOUDFIELD_HXX
27 #include <simgear/compiler.h>
40 bool operator<(const culledCloud &b) const {
41 return (this->dist < b.dist);
44 typedef vector<culledCloud> list_of_culledCloud;
56 // bool operator<(const Cloud &b) {
57 // return this->dist < b.dist;
62 typedef vector<Cloud> list_of_Cloud;
64 // cull all clouds of a tiled field
65 void cullClouds(sgVec3 eyePos, sgMat4 mat);
67 list_of_Cloud theField;
68 // this is a relative position only, with that we can move all clouds at once
69 sgVec3 relative_position;
75 double deltax, deltay, alt;
82 // add one cloud, data is not copied, ownership given
83 void addCloud( sgVec3 pos, SGNewCloud *cloud);
86 void buildTestLayer(void);
88 // Render a cloud field
91 // reposition the cloud layer at the specified origin and orientation
92 void reposition( sgVec3 p, sgVec3 up, double lon, double lat, double alt, double dt);
94 // visibility distance for clouds in meters
95 static float CloudVis;
99 static double fieldSize;
100 static bool enable3D;
102 // return the size of the memory pool used by texture impostors
103 static int get_CacheSize(void);
104 static float get_CloudVis(void) { return CloudVis; }
105 static float get_density(void) { return density; }
106 static bool get_enable3dClouds(void) { return enable3D; }
108 static void set_CacheSize(int sizeKb);
109 static void set_CloudVis(float distance);
110 static void set_density(float density);
111 static void set_enable3dClouds(bool enable);
114 #endif // _CLOUDFIELD_HXX