Changeset 8495 in orxonox.OLD for trunk/src/lib/graphics/effects/rain_effect.h
- Timestamp:
- Jun 15, 2006, 9:50:56 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/effects/rain_effect.h
r8255 r8495 22 22 23 23 24 class RainEffect : public WeatherEffect 25 { 26 public: 27 RainEffect(const TiXmlElement* root = NULL); 28 virtual ~RainEffect(); 24 class RainEffect : public WeatherEffect { 25 public: 26 RainEffect(const TiXmlElement* root = NULL); 27 virtual ~RainEffect(); 29 28 30 29 virtual void loadParams(const TiXmlElement* root); 31 30 32 virtual boolinit();31 virtual void init(); 33 32 34 virtual boolactivate();35 virtual booldeactivate();33 virtual void activate(); 34 virtual void deactivate(); 36 35 37 virtual void tick(float dt); 36 inline void activateRain() { 37 this->activate(); 38 } 39 inline void deactivateRain() { 40 this->deactivate(); 41 } 38 42 39 inline void activateRain() { this->activate(); } 40 inline void deactivateRain() { this->deactivate(); } 41 void startRaining(); 43 virtual void tick(float dt); 42 44 43 inline void setRainCoord(float x, float y, float z) { this->rainCoord = Vector(x, y, z); } 44 inline void setRainSize(float x, float y) { this->rainSize = Vector2D(x, y); } 45 inline void setRainRate(float rate) { this->rainRate = rate;} 46 inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; } 47 inline void setRainLife(float life) { this->rainLife = life; } 48 inline void setRainWind(int force) { this->rainWindForce = force; } 49 inline void setRainStart(float duration) { this->rainStartDuration = duration; } 45 void startRaining(); 46 void stopRaining(); 50 47 51 inline void setRainOption(const std::string& option) { 52 if (option == "moverain") this->rainMove = true; 53 if (option == "activate") this->rainActivate = true; 54 } 48 inline void setRainCoord(float x, float y, float z) { 49 this->rainCoord = Vector(x, y, z); 50 } 51 inline void setRainSize(float x, float y) { 52 this->rainSize = Vector2D(x, y); 53 } 54 inline void setRainRate(float rate) { 55 this->rainRate = rate; 56 } 57 inline void setRainVelocity(float velocity) { 58 this->rainVelocity = -velocity; 59 } 60 inline void setRainLife(float life) { 61 this->rainLife = life; 62 } 63 inline void setRainWind(int force) { 64 this->rainWindForce = force; 65 } 66 67 inline void setRainFadeIn(float fadein) { 68 this->rainFadeInDuration = fadein; 69 } 70 inline void setRainFadeOut(float fadeout) { 71 this->rainFadeOutDuration = fadeout; 72 } 73 74 inline void setRainOption(const std::string& option) { 75 if (option == "moverain") 76 this->rainMove = true; 77 if (option == "activate") 78 this->rainActivate = true; 79 } 55 80 56 81 57 58 static SparkParticles*rainParticles;59 ParticleEmitter*emitter;82 private: 83 static SparkParticles* rainParticles; 84 ParticleEmitter* emitter; 60 85 61 float localTimer; 86 GLfloat rainFadeInDuration; 87 GLfloat rainFadeOutDuration; 88 float localTimer; 62 89 63 Vector rainCoord; 64 Vector2D rainSize; 65 GLfloat rainRate; 66 GLfloat rainVelocity; 67 GLfloat rainLife; 68 GLfloat rainMaxParticles; 69 int rainWindForce; 70 GLfloat rainStartDuration; 71 bool rainMove; 72 bool rainActivate; 90 Vector rainCoord; 91 Vector2D rainSize; 92 GLfloat rainRate; 93 GLfloat rainVelocity; 94 GLfloat rainLife; 95 GLfloat rainMaxParticles; 96 int rainWindForce; 97 bool rainMove; 98 bool rainActivate; 73 99 74 OrxSound::SoundSourcesoundSource;75 OrxSound::SoundBuffer*rainBuffer;76 OrxSound::SoundBuffer*windBuffer;100 OrxSound::SoundSource soundSource; 101 OrxSound::SoundBuffer* rainBuffer; 102 OrxSound::SoundBuffer* windBuffer; 77 103 78 floatsoundRainVolume;104 float soundRainVolume; 79 105 80 LightManager*lightMan;81 GLfloatrainAmbient;106 LightManager* lightMan; 107 GLfloat rainAmbient; 82 108 83 109 };
Note: See TracChangeset
for help on using the changeset viewer.