]> git.mxchange.org Git - simgear.git/blob - simgear/environment/precipitation.hxx
precipitation effects from Nicolas Vivien
[simgear.git] / simgear / environment / precipitation.hxx
1 /**
2  * @file precipitation.hxx
3  * @author Nicolas VIVIEN
4  * @date 2008-02-10
5  *
6  * @note Copyright (C) 2008 Nicolas VIVIEN
7  *
8  * @brief Precipitation effects to draw rain and snow.
9  *
10  * @par Licences
11  *   This program is free software; you can redistribute it and/or
12  *   modify it under the terms of the GNU General Public License as
13  *   published by the Free Software Foundation; either version 2 of the
14  *   License, or (at your option) any later version.
15  *
16  *   This program is distributed in the hope that it will be useful, but
17  *   WITHOUT ANY WARRANTY; without even the implied warranty of
18  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  *   General Public License for more details.
20  *
21  *   You should have received a copy of the GNU General Public License
22  *   along with this program; if not, write to the Free Software
23  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24  *
25  * @par CVS
26  *   $Id$
27  */
28
29 #ifndef _PRECIPITATION_HXX
30 #define _PRECIPITATION_HXX
31
32 #include <osgDB/ReadFile>
33 #include <osgDB/FileUtils>
34 #include <osgUtil/Optimizer>
35 #include <osgUtil/CullVisitor>
36 #include <osgViewer/Viewer>
37
38 #include <osg/Depth>
39 #include <osg/Stencil>
40 #include <osg/ClipPlane>
41 #include <osg/ClipNode>
42 #include <osg/MatrixTransform>
43 #include <osgUtil/TransformCallback>
44 #include <osgParticle/PrecipitationEffect>
45
46
47 class SGPrecipitation {
48 private:
49         bool _freeze;
50
51         float _snow_intensity;
52         float _rain_intensity;
53         
54         int _wind_dir;
55         osg::Vec3 _wind_vec;
56         
57         osg::Group *group;
58         osg::ref_ptr<osgParticle::PrecipitationEffect> precipitationEffect;
59
60 public:
61         SGPrecipitation();
62         ~SGPrecipitation();
63         osg::Group* build(void);
64         bool update(void);
65         
66         void setWindProperty(double, double);
67         void setFreezing(bool);
68         void setRainIntensity(float);
69         void setSnowIntensity(float);
70 };
71
72 #endif