]> git.mxchange.org Git - simgear.git/commitdiff
Remove unused class SGEnviro
authorTorsten Dreyer <Torsten@t3r.de>
Fri, 6 May 2011 12:10:04 +0000 (14:10 +0200)
committerTorsten Dreyer <Torsten@t3r.de>
Fri, 6 May 2011 12:10:04 +0000 (14:10 +0200)
This class and their source files visual_enviro.[h|c]xx were
unused since OSG transition. It's only functionality was to
keep a variable for the enable-state of rendering of precipitation.
This has now been moved to SGPrecipitation.

simgear/environment/Makefile.am
simgear/environment/precipitation.cxx
simgear/environment/precipitation.hxx

index f6042f85025d0d52dc6ef9347dd136af72256b9a..30e4af375f4b2203512a755cc5c60b8951a5dcea 100644 (file)
@@ -2,8 +2,8 @@ includedir = @includedir@/environment
 
 lib_LIBRARIES = libsgenvironment.a
 
-include_HEADERS = metar.hxx visual_enviro.hxx precipitation.hxx
+include_HEADERS = metar.hxx precipitation.hxx
 
-libsgenvironment_a_SOURCES = metar.cxx visual_enviro.cxx precipitation.cxx
+libsgenvironment_a_SOURCES = metar.cxx precipitation.cxx
 
 INCLUDES = -I$(top_srcdir)
index 075fac1d868744611c8183b66201feeef0c46d39..d22bbfd8e8eba15c4e71f1fd2c24e5ed6447a987 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include "precipitation.hxx"
-#include "visual_enviro.hxx"
+//#include "visual_enviro.hxx"
 
 #include <simgear/constants.h>
 #include <osg/ClipNode>
  * Build a new OSG object from osgParticle.
  */
 SGPrecipitation::SGPrecipitation() :
-    _freeze(false), _snow_intensity(0.0), _rain_intensity(0.0), _clip_distance(5.0)
+    _freeze(false), _enabled(true), _snow_intensity(0.0), _rain_intensity(0.0), _clip_distance(5.0)
 {
     _precipitationEffect = new osgParticle::PrecipitationEffect;
 }
 
+void SGPrecipitation::setEnabled( bool value )
+{
+    _enabled = value;
+}
+
+bool SGPrecipitation::getEnabled() const
+{
+    return _enabled;
+}
 
 /**
  * @brief Build and add the object "precipitationEffect"
@@ -161,8 +170,7 @@ bool SGPrecipitation::update(void)
             this->_snow_intensity = this->_rain_intensity;
     }
 
-    bool enabled = sgEnviro.get_precipitation_enable_state();
-    if (enabled && this->_snow_intensity > 0) {
+    if (_enabled && this->_snow_intensity > 0) {
         _precipitationEffect->setWind(_wind_vec);
         _precipitationEffect->setParticleSpeed( -0.75f - 0.25f*_snow_intensity);
                
@@ -174,7 +182,7 @@ bool SGPrecipitation::update(void)
         _precipitationEffect->setFarTransition(100.0f - 60.0f*sqrtf(_snow_intensity));
                
         _precipitationEffect->setParticleColor(osg::Vec4(0.85, 0.85, 0.85, 1.0) - osg::Vec4(0.1, 0.1, 0.1, 1.0) * _snow_intensity);
-    } else if (enabled && this->_rain_intensity > 0) {
+    } else if (_enabled && this->_rain_intensity > 0) {
         _precipitationEffect->setWind(_wind_vec);
         _precipitationEffect->setParticleSpeed( -2.0f + -5.0f*_rain_intensity);
                
index bcf568c63708c2a5cc6e3ed71c82bf1b2d4a5faa..8552647e15bf63cedad10e7d490bc571016645d3 100644 (file)
@@ -36,6 +36,7 @@ class SGPrecipitation : public osg::Referenced
 {
 private:
     bool _freeze;
+    bool _enabled;
 
     float _snow_intensity;
     float _rain_intensity;
@@ -56,6 +57,9 @@ public:
     void setFreezing(bool);
     void setRainIntensity(float);
     void setSnowIntensity(float);
+
+    void setEnabled( bool );
+    bool getEnabled() const;
 };
 
 #endif