*/
#include "precipitation.hxx"
+#include "visual_enviro.hxx"
#include <simgear/constants.h>
this->_snow_intensity = this->_rain_intensity;
}
- if (this->_snow_intensity > 0) {
+ bool enabled = sgEnviro.get_precipitation_enable_state();
+ if (enabled && this->_snow_intensity > 0) {
_precipitationEffect->setWind(_wind_vec);
_precipitationEffect->setParticleSpeed( -0.75f - 0.25f*_snow_intensity);
_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 (this->_rain_intensity > 0){
+ } else if (enabled && this->_rain_intensity > 0) {
_precipitationEffect->setWind(_wind_vec);
_precipitationEffect->setParticleSpeed( -2.0f + -5.0f*_rain_intensity);