2008-03-04 09:02:24 +00:00
|
|
|
/**
|
|
|
|
* @file precipitation_mgr.hxx
|
|
|
|
* @author Nicolas VIVIEN
|
|
|
|
* @date 2008-02-10
|
|
|
|
*
|
|
|
|
* @note Copyright (C) 2008 Nicolas VIVIEN
|
|
|
|
*
|
|
|
|
* @brief Precipitation manager
|
|
|
|
* This manager calculate the intensity of precipitation in function of the altitude,
|
|
|
|
* calculate the wind direction and velocity, then update the drawing of precipitation.
|
|
|
|
*
|
|
|
|
* @par Licences
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PRECIPITATION_MGR_HXX
|
|
|
|
#define _PRECIPITATION_MGR_HXX
|
|
|
|
|
2008-03-04 09:03:54 +00:00
|
|
|
#include <simgear/structure/subsystem_mgr.hxx>
|
2008-03-04 09:02:24 +00:00
|
|
|
#include <simgear/environment/precipitation.hxx>
|
2011-05-06 12:12:17 +00:00
|
|
|
#include <simgear/props/tiedpropertylist.hxx>
|
2008-11-25 22:50:04 +00:00
|
|
|
|
2008-03-04 09:03:54 +00:00
|
|
|
class FGPrecipitationMgr : public SGSubsystem
|
|
|
|
{
|
2008-03-04 09:02:24 +00:00
|
|
|
private:
|
2017-03-21 20:43:42 +00:00
|
|
|
#ifndef FG_TESTLIB
|
2008-03-04 09:03:54 +00:00
|
|
|
osg::ref_ptr<osg::MatrixTransform> transform;
|
|
|
|
osg::ref_ptr<SGPrecipitation> precipitation;
|
2017-03-21 20:43:42 +00:00
|
|
|
#endif
|
2008-03-04 09:03:54 +00:00
|
|
|
float getPrecipitationAtAltitudeMax(void);
|
2011-05-06 12:12:17 +00:00
|
|
|
simgear::TiedPropertyList _tiedProperties;
|
2008-03-04 09:02:24 +00:00
|
|
|
|
|
|
|
public:
|
2008-03-04 09:03:54 +00:00
|
|
|
FGPrecipitationMgr();
|
|
|
|
virtual ~FGPrecipitationMgr();
|
|
|
|
|
|
|
|
// SGSubsystem methods
|
2011-05-06 12:12:17 +00:00
|
|
|
virtual void bind ();
|
|
|
|
virtual void unbind ();
|
2008-03-04 09:03:54 +00:00
|
|
|
virtual void init ();
|
|
|
|
virtual void update (double dt);
|
2017-03-21 20:43:42 +00:00
|
|
|
|
2016-05-03 07:56:06 +00:00
|
|
|
void setupSceneGraph(void);
|
2008-11-25 22:50:04 +00:00
|
|
|
void setPrecipitationLevel(double l);
|
2008-03-04 09:02:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|