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