|
UFO: Alien Invasion
|
#include <r_weather.h>

Data Structures | |
| struct | particle |
Public Types | |
| enum | weatherTypes { WEATHER_CLEAN , WEATHER_RAIN , WEATHER_SNOW , WEATHER_SANDSTORM , WEATHER_MAX } |
Public Member Functions | |
| Weather (void) | |
| make a default (clean) weather | |
| Weather (weatherTypes weather) | |
| make a weather of given type | |
| virtual | ~Weather () |
| void | setDefaults (void) |
| Sets clean weather, but generate some parameters usable for easily changing it into the worse varieties. | |
| void | changeTo (weatherTypes weather) |
| changes to weather of given type; parameters are randomized | |
| void | clearParticles (void) |
| Just a shared methods for ctors to initialize the weather. | |
| void | update (int milliseconds) |
| Updates weather for the time passed; handles particle creation/removal automatically. | |
| void | render (void) |
| Draws weather effects. | |
Data Fields | |
| weatherTypes | weatherType |
| float | weatherStrength |
| float | windStrength |
| float | windDirection |
| float | windTurbulence |
| float | fallingSpeed |
| int | splashTime |
| float | splashSize |
Protected Attributes | |
| float | smearLength |
| float | particleSize |
| vec4_t | color |
| particle | particles [MAX_PARTICLES] |
Static Protected Attributes | |
| static const size_t | MAX_PARTICLES = 8192 |
Definition at line 29 of file r_weather.h.
| Enumerator | |
|---|---|
| WEATHER_CLEAN | |
| WEATHER_RAIN | |
| WEATHER_SNOW | |
| WEATHER_SANDSTORM | |
| WEATHER_MAX | |
Definition at line 32 of file r_weather.h.
| Weather::Weather | ( | void | ) |
make a default (clean) weather
< final particle size
Definition at line 142 of file r_weather.cpp.
References clearParticles(), and setDefaults().
| Weather::Weather | ( | weatherTypes | weather | ) |
make a weather of given type
Definition at line 151 of file r_weather.cpp.
References changeTo(), and clearParticles().
|
virtual |
Definition at line 157 of file r_weather.cpp.
| void Weather::changeTo | ( | weatherTypes | weather | ) |
changes to weather of given type; parameters are randomized
Definition at line 91 of file r_weather.cpp.
References color, fallingSpeed, frand(), particleSize, setDefaults(), smearLength, splashSize, splashTime, WEATHER_RAIN, WEATHER_SANDSTORM, WEATHER_SNOW, weatherStrength, weatherType, windStrength, and windTurbulence.
Referenced by Weather().
Just a shared methods for ctors to initialize the weather.
Definition at line 132 of file r_weather.cpp.
References i, MAX_PARTICLES, and particles.
Draws weather effects.
Definition at line 257 of file r_weather.cpp.
References color, Cvar_GetInteger(), glBindTexture(), i, MAX_PARTICLES, particles, particleSize, R_BindArray(), R_Color(), R_EnableBlend(), R_ResetArrayState(), refdef, smearLength, splashSize, splashTime, Weather::particle::ttl, VectorLength(), Weather::particle::vz, wpTexture(), Weather::particle::x, Weather::particle::y, and Weather::particle::z.
Sets clean weather, but generate some parameters usable for easily changing it into the worse varieties.
Definition at line 71 of file r_weather.cpp.
References color, fallingSpeed, frand(), M_PI_2, particleSize, smearLength, splashSize, splashTime, WEATHER_CLEAN, weatherStrength, weatherType, windDirection, windStrength, and windTurbulence.
Referenced by changeTo(), and Weather().
Updates weather for the time passed; handles particle creation/removal automatically.
< extents of zone in which weather particles will be rendered
Definition at line 164 of file r_weather.cpp.
References cl, CL_Trace(), Com_Printf(), crand(), Cvar_GetInteger(), AABB::EMPTY, AABB::expandXY(), fallingSpeed, trace_t::fraction, frand(), AABB::getMaxX(), AABB::getMaxY(), AABB::getMaxZ(), AABB::getMinX(), AABB::getMinY(), AABB::getMinZ(), i, MASK_SOLID, MAX_PARTICLES, AABB::maxs, particles, splashTime, Line::start, Line::stop, Weather::particle::timeout, Weather::particle::ttl, VectorSet, Weather::particle::vx, Weather::particle::vy, Weather::particle::vz, weatherStrength, windDirection, windStrength, windTurbulence, Weather::particle::x, Weather::particle::y, and Weather::particle::z.
|
protected |
< how much to scale from default
Definition at line 58 of file r_weather.h.
Referenced by changeTo(), render(), and setDefaults().
| float Weather::fallingSpeed |
< variety of wind strength and direction in units per second
Definition at line 38 of file r_weather.h.
Referenced by changeTo(), setDefaults(), and update().
|
staticprotected |
Definition at line 54 of file r_weather.h.
Referenced by clearParticles(), render(), and update().
|
protected |
Definition at line 67 of file r_weather.h.
Referenced by clearParticles(), render(), and update().
|
protected |
< how much particle is motion-blurred, in seconds
Definition at line 56 of file r_weather.h.
Referenced by changeTo(), render(), and setDefaults().
|
protected |
< particle array size, must be a power of two
Definition at line 55 of file r_weather.h.
Referenced by changeTo(), render(), and setDefaults().
| float Weather::splashSize |
< how long splash effect is being played, in milliseconds
Definition at line 41 of file r_weather.h.
Referenced by changeTo(), render(), and setDefaults().
| int Weather::splashTime |
< how fast particles fall
Definition at line 40 of file r_weather.h.
Referenced by changeTo(), render(), setDefaults(), and update().
| float Weather::weatherStrength |
Definition at line 34 of file r_weather.h.
Referenced by changeTo(), setDefaults(), and update().
| weatherTypes Weather::weatherType |
Definition at line 33 of file r_weather.h.
Referenced by changeTo(), and setDefaults().
| float Weather::windDirection |
| float Weather::windStrength |
< 0 to 1, amount of particles generated, 1 is the maximum possible
Definition at line 35 of file r_weather.h.
Referenced by changeTo(), setDefaults(), and update().
| float Weather::windTurbulence |
< in radians, 0 is due east
Definition at line 37 of file r_weather.h.
Referenced by changeTo(), setDefaults(), and update().