UFO: Alien Invasion
Loading...
Searching...
No Matches
r_weather.h
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 2013 Alexander Y. Tishin
8Copyright (C) 2013-2020 UFO: Alien Invasion.
9
10This program is free software; you can redistribute it and/or
11modify it under the terms of the GNU General Public License
12as published by the Free Software Foundation; either version 2
13of the License, or (at your option) any later version.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
19See the GNU General Public License for more details.
20
21You should have received a copy of the GNU General Public License
22along with this program; if not, write to the Free Software
23Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
25*/
26
27#pragma once
28
29class Weather {
30 public:
31 /* public members are intended; they are to avoid need of getters/setters to change weather in-flight */
39
41 float splashSize;
42
43 Weather(void);
44 Weather(weatherTypes weather);
45 virtual ~Weather();
46
47 void setDefaults(void);
48 void changeTo(weatherTypes weather);
49 void clearParticles(void);
50
51 void update(int milliseconds);
52 void render(void);
53 protected:
54 static const size_t MAX_PARTICLES = 8192;
57
59
60 struct particle {
61 GLfloat x, y, z;
62 GLfloat vx, vy, vz;
63 int timeout;
64 int ttl;
65 };
66
68};
void setDefaults(void)
Sets clean weather, but generate some parameters usable for easily changing it into the worse varieti...
Definition r_weather.cpp:71
float fallingSpeed
Definition r_weather.h:38
int splashTime
Definition r_weather.h:40
Weather(void)
make a default (clean) weather
float windTurbulence
Definition r_weather.h:37
virtual ~Weather()
void render(void)
Draws weather effects.
float weatherStrength
Definition r_weather.h:34
float particleSize
Definition r_weather.h:56
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.
float smearLength
Definition r_weather.h:55
@ WEATHER_MAX
Definition r_weather.h:32
@ WEATHER_SNOW
Definition r_weather.h:32
@ WEATHER_SANDSTORM
Definition r_weather.h:32
@ WEATHER_CLEAN
Definition r_weather.h:32
@ WEATHER_RAIN
Definition r_weather.h:32
float windStrength
Definition r_weather.h:35
void changeTo(weatherTypes weather)
changes to weather of given type; parameters are randomized
Definition r_weather.cpp:91
static const size_t MAX_PARTICLES
Definition r_weather.h:54
float windDirection
Definition r_weather.h:36
particle particles[MAX_PARTICLES]
Definition r_weather.h:67
float splashSize
Definition r_weather.h:41
vec4_t color
Definition r_weather.h:58
weatherTypes weatherType
Definition r_weather.h:33
vec_t vec4_t[4]
Definition ufotypes.h:40