Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h @ 8022

Last change on this file since 8022 was 8020, checked in by hdavid, 18 years ago

branches/atmospheric_engine: activating/deactivating rainEffect in the oxw-file works,default: deactivate

File size: 1.9 KB
Line 
1/**
2* @file rain_effect.h
3*/
4
5#ifndef _RAIN_EFFECT
6#define _RAIN_EFFECT
7
8#include "vector.h"
9#include "vector2D.h"
10#include <string>
11
12#include "particle_system.h"
13
14class SparkParticles;
15class PlainEmitter;
16
17#include "weather_effect.h"
18
19#include "sound_buffer.h"
20#include "sound_source.h"
21
22
23class RainEffect : public WeatherEffect
24{
25        public:
26                RainEffect(const TiXmlElement* root = NULL);
27                virtual ~RainEffect();
28
29                virtual void loadParams(const TiXmlElement* root);
30
31                virtual bool init();
32
33                virtual bool activate();
34                virtual bool deactivate();
35
36                void activateRain();
37                void deactivateRain();
38
39                virtual void tick(float dt);
40
41                inline void setRainCoord(float x, float y, float z) { this->rainCoord = Vector(x, y, z); }
42                inline void setRainSize(float x, float y) { this->rainSize = Vector2D(x, y); }
43                inline void setRainRate(float rate) { this->rainRate = rate;}
44                inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; }
45                inline void setRainLife(float life) { this->rainLife = life; }
46                inline void setRainWind(int force) { this->rainWindForce = force; }
47                inline void setRainOption(const std::string& option) { if (option == "moverain") this->rainMove = true;
48                                                                                if (option == "activate") this->rainActivate = true; }
49
50
51        private:
52                static SparkParticles*                                          rainParticles;
53                ParticleEmitter*                                                                        emitter;
54
55                Vector                                                                                                          rainCoord;
56                Vector2D                                                                                                        rainSize;
57                GLfloat                                                                                                         rainRate;
58                GLfloat                                                                                                         rainVelocity;
59                GLfloat                                                                                                         rainLife;
60                GLfloat                                                                                                         rainMaxParticles;
61                int                                                                                                                             rainWindForce;
62                bool                                                                                                                    rainMove;
63    bool                              rainActivate;
64
65                OrxSound::SoundSource                   soundSource;
66                OrxSound::SoundBuffer*                  rainBuffer;
67                OrxSound::SoundBuffer*                  windBuffer;
68};
69
70
71#endif  /* _RAIN_EFFECT */
Note: See TracBrowser for help on using the repository browser.