]> git.mxchange.org Git - simgear.git/blob - simgear/scene/sky/newcloud.hxx
Merge branch 'next' of git.gitorious.org:fg/simgear into next
[simgear.git] / simgear / scene / sky / newcloud.hxx
1 // 3D cloud class
2 //
3 // Written by Harald JOHNSEN, started April 2005.
4 //
5 // Copyright (C) 2005  Harald JOHNSEN - hjohnsen@evc.net
6 //
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.
11 //
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.
16 //
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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 //
22
23 #ifndef _NEWCLOUD_HXX
24 #define _NEWCLOUD_HXX
25
26 #include <simgear/compiler.h>
27 #include <string>
28 #include <vector>
29 #include <osg/Fog>
30
31 #include <simgear/scene/material/Effect.hxx>
32 #include <simgear/scene/material/EffectGeode.hxx>
33
34 using std::string;
35 using std::vector;
36
37 /**
38  * 3D cloud class.
39  */
40 class SGNewCloud {
41
42 public:
43         SGNewCloud(const SGPath &texture_root, const SGPropertyNode *cld_def);
44
45         ~SGNewCloud();
46
47         // Generate a Cloud
48         osg::ref_ptr<simgear::EffectGeode> genCloud ();
49
50         static double getDensity(void)
51         {
52             return sprite_density;
53         }
54     
55         // Set the sprite density
56         static void setDensity(double d)
57         {
58             sprite_density = d;
59         }
60         
61
62 private:
63
64         double min_width;
65         double max_width;
66         double min_height;
67         double max_height;
68         double min_sprite_width;
69         double max_sprite_width;
70         double min_sprite_height;
71         double max_sprite_height;
72         double bottom_shade;
73         double zscale;
74         bool height_map_texture;
75         int num_sprites;
76         int num_textures_x;
77         int num_textures_y;
78         string texture;
79         osg::Geometry* quad;
80         osg::ref_ptr<simgear::Effect> effect;
81         static double sprite_density;
82
83         osg::Geometry* createOrthQuad(float w, float h, int varieties_x, int varieties_y);
84
85 };
86
87
88
89 #endif // _NEWCLOUD_HXX