]> git.mxchange.org Git - simgear.git/blob - simgear/scene/sky/newcloud.hxx
Stuart Buchanan :
[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 <plib/sg.h>
27 #include <simgear/compiler.h>
28 #include <string>
29 #include <vector>
30 #include <osg/Fog>
31
32 #include "bbcache.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 &tex_path, 
44                     string tex,
45                     double min_w,
46                     double max_w,
47                     double min_h,
48                     double max_h,
49                     double min_sprite_w,
50                     double max_sprite_w,
51                     double min_sprite_h,
52                     double max_sprite_h,
53                     double b,
54                     int n,
55                     int nt_x,
56                     int nt_y);
57         
58         ~SGNewCloud();
59
60         // Generate a Cloud
61         osg::ref_ptr<osg::Geode> genCloud ();
62
63 private:
64
65         double min_width;
66         double max_width;
67         double min_height;
68         double max_height;
69         double min_sprite_width;
70         double max_sprite_width;
71         double min_sprite_height;
72         double max_sprite_height;
73         double bottom_shade;
74         int num_sprites;
75         int num_textures_x;
76         int num_textures_y;
77         const string texture;
78         osg::Geometry* quad;
79         osg::ref_ptr<osg::StateSet> stateSet;
80
81         osg::Geometry* createOrthQuad(float w, float h, int varieties_x, int varieties_y);
82
83 public:
84
85 };
86
87
88 #endif // _NEWCLOUD_HXX