// Time passed in here is global time, not delta time
// The function returns the time at which it must be called again
floatWindThink(floatflTime);
// FIXME: These really should be private
CNetworkVar(float,m_flStartTime);
CNetworkVar(int,m_iWindSeed);// random number seed...
CNetworkVar(int,m_iMinWind);// the slowest the wind can normally blow
CNetworkVar(int,m_iMaxWind);// the fastest the wind can normally blow
CNetworkVar(int,m_windRadius);// the radius this entity affects with its windiness, so a map can have multiple
CNetworkVar(int,m_iMinGust);// the slowest that a gust can be
CNetworkVar(int,m_iMaxGust);// the fastest that a gust can be
CNetworkVar(float,m_flMinGustDelay);// min time between gusts
CNetworkVar(float,m_flMaxGustDelay);// max time between gusts
CNetworkVar(float,m_flGustDuration);// max time between gusts
CNetworkVar(int,m_iGustDirChange);// max number of degrees wind dir changes on gusts.
CNetworkVector(m_location);// The location of this wind controller
intm_iszGustSound;// name of the wind sound to play for gusts.
intm_iWindDir;// wind direction (yaw)
floatm_flWindSpeed;// the wind speed
Vectorm_currentWindVector;// For all the talk of proper prediction, we ended up just storing and returning through a static vector. Now we can have multiple env_wind, so we need this in here.
Vectorm_CurrentSwayVector;
Vectorm_PrevSwayVector;
CNetworkVar(int,m_iInitialWindDir);
CNetworkVar(float,m_flInitialWindSpeed);
#ifndef CLIENT_DLL
COutputEventm_OnGustStart;
COutputEventm_OnGustEnd;
#endif
private:
structWindAveEvent_t
{
floatm_flStartWindSpeed;// the wind speed at the time of the event
floatm_flAveWindSpeed;// the average wind speed of the event
};
structWindVariationEvent_t
{
floatm_flWindAngleVariation;
floatm_flWindSpeedVariation;
};
voidComputeWindVariation(floatflTime);
// Updates the wind sound
voidUpdateWindSound(floatflTotalWindSpeed);
voidUpdateTreeSway(floatflTime);
floatm_flVariationTime;
floatm_flSwayTime;
floatm_flSimTime;// What's the time I last simulated up to?
floatm_flSwitchTime;// when do I actually switch from gust to not gust
floatm_flAveWindSpeed;// the average wind speed
boolm_bGusting;// is the wind gusting right now?
floatm_flWindAngleVariation;
floatm_flWindSpeedVariation;
intm_iEntIndex;
// Used to generate random numbers
CUniformRandomStreamm_Stream;
// NOTE: In order to make this algorithm independent of calling frequency
// I have to decouple the stream used to generate average wind speed
// and the stream used to generate wind variation since they are