Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/graphics/effects/rain_effect.h @ 7810

Last change on this file since 7810 was 7810, checked in by bensch, 18 years ago

orxonox/trunk: merged the Weather effects back here

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