|
|
|
@ -1138,7 +1138,7 @@ SkyManager::SkyManager(osg::Group* parentNode, Resource::SceneManager* sceneMana
|
|
|
|
|
, mBaseWindSpeed(0.f)
|
|
|
|
|
, mEnabled(true)
|
|
|
|
|
, mSunEnabled(true)
|
|
|
|
|
, mEffectFade(0.f)
|
|
|
|
|
, mPrecipitationAlpha(0.f)
|
|
|
|
|
{
|
|
|
|
|
osg::ref_ptr<CameraRelativeTransform> skyroot (new CameraRelativeTransform);
|
|
|
|
|
skyroot->setName("Sky Root");
|
|
|
|
@ -1516,7 +1516,7 @@ void SkyManager::createRain()
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osgParticle::ModularProgram> program (new osgParticle::ModularProgram);
|
|
|
|
|
program->addOperator(new WrapAroundOperator(mCamera,rainRange));
|
|
|
|
|
program->addOperator(new WeatherAlphaOperator(mEffectFade, true));
|
|
|
|
|
program->addOperator(new WeatherAlphaOperator(mPrecipitationAlpha, true));
|
|
|
|
|
program->setParticleSystem(mRainParticleSystem);
|
|
|
|
|
mRainNode->addChild(program);
|
|
|
|
|
|
|
|
|
@ -1575,10 +1575,10 @@ bool SkyManager::hasRain() const
|
|
|
|
|
return mRainNode != nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float SkyManager::getEffectFade() const
|
|
|
|
|
float SkyManager::getPrecipitationAlpha() const
|
|
|
|
|
{
|
|
|
|
|
if (mEnabled && !mIsStorm && (hasRain() || mParticleNode))
|
|
|
|
|
return mEffectFade;
|
|
|
|
|
return mPrecipitationAlpha;
|
|
|
|
|
|
|
|
|
|
return 0.f;
|
|
|
|
|
}
|
|
|
|
@ -1722,7 +1722,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
|
|
|
|
|
SceneUtil::AssignControllerSourcesVisitor assignVisitor(std::shared_ptr<SceneUtil::ControllerSource>(new SceneUtil::FrameTimeSource));
|
|
|
|
|
mParticleEffect->accept(assignVisitor);
|
|
|
|
|
|
|
|
|
|
AlphaFader::SetupVisitor alphaFaderSetupVisitor(mEffectFade);
|
|
|
|
|
AlphaFader::SetupVisitor alphaFaderSetupVisitor(mPrecipitationAlpha);
|
|
|
|
|
|
|
|
|
|
mParticleEffect->accept(alphaFaderSetupVisitor);
|
|
|
|
|
|
|
|
|
@ -1739,7 +1739,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
|
|
|
|
|
osg::ref_ptr<osgParticle::ModularProgram> program (new osgParticle::ModularProgram);
|
|
|
|
|
if (!mIsStorm)
|
|
|
|
|
program->addOperator(new WrapAroundOperator(mCamera,osg::Vec3(1024,1024,800)));
|
|
|
|
|
program->addOperator(new WeatherAlphaOperator(mEffectFade, false));
|
|
|
|
|
program->addOperator(new WeatherAlphaOperator(mPrecipitationAlpha, false));
|
|
|
|
|
program->setParticleSystem(ps);
|
|
|
|
|
mParticleNode->addChild(program);
|
|
|
|
|
}
|
|
|
|
@ -1828,7 +1828,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
|
|
|
|
|
|
|
|
|
|
mAtmosphereNightNode->setNodeMask(weather.mNight ? ~0 : 0);
|
|
|
|
|
|
|
|
|
|
mEffectFade = weather.mEffectFade;
|
|
|
|
|
mPrecipitationAlpha = weather.mPrecipitationAlpha;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float SkyManager::getBaseWindSpeed() const
|
|
|
|
|