mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 21:40:15 +00:00
Add an API to get base wind speed (which is from openmw.cfg)
This commit is contained in:
parent
f175beb304
commit
0418e8e7a6
@ -1134,6 +1134,7 @@ SkyManager::SkyManager(osg::Group* parentNode, Resource::SceneManager* sceneMana
|
||||
, mRainEntranceSpeed(1)
|
||||
, mRainMaxRaindrops(0)
|
||||
, mWindSpeed(0.f)
|
||||
, mBaseWindSpeed(0.f)
|
||||
, mEnabled(true)
|
||||
, mSunEnabled(true)
|
||||
, mWeatherAlpha(0.f)
|
||||
@ -1685,6 +1686,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
|
||||
mRainMaxHeight = weather.mRainMaxHeight;
|
||||
mRainSpeed = weather.mRainSpeed;
|
||||
mWindSpeed = weather.mWindSpeed;
|
||||
mBaseWindSpeed = weather.mBaseWindSpeed;
|
||||
|
||||
if (mRainEffect != weather.mRainEffect)
|
||||
{
|
||||
@ -1853,6 +1855,13 @@ void SkyManager::setWeather(const WeatherResult& weather)
|
||||
fader->setAlpha(weather.mEffectFade);
|
||||
}
|
||||
|
||||
float SkyManager::getBaseWindSpeed() const
|
||||
{
|
||||
if (!mCreated) return 0.f;
|
||||
|
||||
return mBaseWindSpeed;
|
||||
}
|
||||
|
||||
void SkyManager::sunEnable()
|
||||
{
|
||||
if (!mCreated) return;
|
||||
|
@ -70,6 +70,7 @@ namespace MWRender
|
||||
float mDLFogOffset;
|
||||
|
||||
float mWindSpeed;
|
||||
float mBaseWindSpeed;
|
||||
float mCurrentWindSpeed;
|
||||
float mNextWindSpeed;
|
||||
|
||||
@ -181,6 +182,8 @@ namespace MWRender
|
||||
|
||||
void setRainIntensityUniform(osg::Uniform *uniform);
|
||||
|
||||
float getBaseWindSpeed() const;
|
||||
|
||||
private:
|
||||
void create();
|
||||
///< no need to call this, automatically done on first enable()
|
||||
@ -265,6 +268,7 @@ namespace MWRender
|
||||
float mRainEntranceSpeed;
|
||||
int mRainMaxRaindrops;
|
||||
float mWindSpeed;
|
||||
float mBaseWindSpeed;
|
||||
|
||||
bool mEnabled;
|
||||
bool mSunEnabled;
|
||||
|
@ -1123,6 +1123,7 @@ inline void WeatherManager::calculateResult(const int weatherID, const float gam
|
||||
mResult.mCloudBlendFactor = 0;
|
||||
mResult.mNextWindSpeed = 0;
|
||||
mResult.mWindSpeed = mResult.mCurrentWindSpeed = calculateWindSpeed(weatherID, mWindSpeed);
|
||||
mResult.mBaseWindSpeed = mWeatherSettings[weatherID].mWindSpeed;
|
||||
|
||||
mResult.mCloudSpeed = current.mCloudSpeed;
|
||||
mResult.mGlareView = current.mGlareView;
|
||||
@ -1214,6 +1215,7 @@ inline void WeatherManager::calculateTransitionResult(const float factor, const
|
||||
|
||||
mResult.mCurrentWindSpeed = calculateWindSpeed(mCurrentWeather, mCurrentWindSpeed);
|
||||
mResult.mNextWindSpeed = calculateWindSpeed(mNextWeather, mNextWindSpeed);
|
||||
mResult.mBaseWindSpeed = lerp(current.mBaseWindSpeed, other.mBaseWindSpeed, factor);
|
||||
|
||||
mResult.mWindSpeed = lerp(mResult.mCurrentWindSpeed, mResult.mNextWindSpeed, factor);
|
||||
mResult.mCloudSpeed = lerp(current.mCloudSpeed, other.mCloudSpeed, factor);
|
||||
|
Loading…
x
Reference in New Issue
Block a user