Changeset 8771 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
- Timestamp:
- Jun 24, 2006, 3:35:07 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
r8521 r8771 1 1 /** 2 * @file rain_effect.h 2 * @file rain_effect.h 3 * Generates rain using the particle engine 3 4 */ 4 5 5 6 #ifndef _RAIN_EFFECT 6 7 #define _RAIN_EFFECT 8 9 #include "weather_effect.h" 7 10 8 11 #include "vector.h" … … 16 19 class LightManager; 17 20 18 #include "weather_effect.h"19 20 21 #include "sound_buffer.h" 21 22 #include "sound_source.h" 22 23 24 class RainEffect : public WeatherEffect 25 { 26 public: 27 RainEffect(const TiXmlElement* root = NULL); 28 virtual ~RainEffect(); 23 29 24 class RainEffect : public WeatherEffect { 25 public: 26 RainEffect(const TiXmlElement* root = NULL); 27 virtual ~RainEffect(); 30 virtual void loadParams(const TiXmlElement* root); 28 31 29 virtual void loadParams(const TiXmlElement* root);32 virtual void init(); 30 33 31 virtual void init(); 34 virtual void activate(); 35 virtual void deactivate(); 32 36 33 virtual void activate(); 34 virtual void deactivate(); 37 inline void activateRain() 38 { 39 this->activate(); 40 } 35 41 36 inline void activateRain() { 37 this->activate(); 38 } 42 inline void deactivateRain() 43 { 44 this->deactivate(); 45 } 39 46 40 inline void deactivateRain() { 41 this->deactivate(); 42 } 47 virtual void tick(float dt); 43 48 44 virtual void tick(float dt); 49 void startRaining(); 50 void stopRaining(); 45 51 46 void startRaining(); 47 void stopRaining(); 52 void hideRain(); 48 53 49 void hideRain(); 54 inline void setRainCoord(float x, float y, float z) 55 { 56 this->rainCoord = Vector(x, y, z); 57 } 58 inline void setRainSize(float x, float y) 59 { 60 this->rainSize = Vector2D(x, y); 61 } 62 inline void setRainRate(float rate) 63 { 64 this->rainRate = rate; 65 } 66 inline void setRainVelocity(float velocity) 67 { 68 this->rainVelocity = -velocity; 69 } 70 inline void setRainLife(float life) 71 { 72 this->rainLife = life; 73 } 74 inline void setRainWind(int force) 75 { 76 this->rainWindForce = force; 77 } 50 78 51 inline void setRainCoord(float x, float y, float z) { 52 this->rainCoord = Vector(x, y, z); 53 } 54 inline void setRainSize(float x, float y) { 55 this->rainSize = Vector2D(x, y); 56 } 57 inline void setRainRate(float rate) { 58 this->rainRate = rate; 59 } 60 inline void setRainVelocity(float velocity) { 61 this->rainVelocity = -velocity; 62 } 63 inline void setRainLife(float life) { 64 this->rainLife = life; 65 } 66 inline void setRainWind(int force) { 67 this->rainWindForce = force; 68 } 79 inline void setRainFadeIn(float fadein) 80 { 81 this->rainFadeInDuration = fadein; 82 } 83 inline void setRainFadeOut(float fadeout) 84 { 85 this->rainFadeOutDuration = fadeout; 86 } 69 87 70 inline void setRainFadeIn(float fadein) { 71 this->rainFadeInDuration = fadein; 72 } 73 inline void setRainFadeOut(float fadeout) { 74 this->rainFadeOutDuration = fadeout; 75 } 76 77 inline void setRainOption(const std::string& option) { 78 if (option == "moverain") 79 this->rainMove = true; 80 if (option == "activate") 81 this->rainActivate = true; 82 } 88 inline void setRainOption(const std::string& option) 89 { 90 if (option == "moverain") 91 this->rainMove = true; 92 if (option == "activate") 93 this->rainActivate = true; 94 } 83 95 84 96 85 97 private: 86 87 98 static SparkParticles* rainParticles; 99 ParticleEmitter* emitter; 88 100 89 GLfloat rainFadeInDuration; 90 GLfloat rainFadeOutDuration; 91 float localTimer; 101 float localTimer; 92 102 93 Vector rainCoord; 94 Vector2D rainSize; 95 GLfloat rainRate; 96 GLfloat rainVelocity; 97 GLfloat rainLife; 98 GLfloat rainMaxParticles; 99 int rainWindForce; 100 bool rainMove; 101 bool rainActivate; 103 GLfloat rainFadeInDuration; 104 GLfloat rainFadeOutDuration; 102 105 103 OrxSound::SoundSource soundSource; 104 OrxSound::SoundBuffer* rainBuffer; 105 OrxSound::SoundBuffer* windBuffer; 106 Vector rainCoord; 107 Vector2D rainSize; 108 GLfloat rainRate; 109 GLfloat rainVelocity; 110 GLfloat rainLife; 111 GLfloat rainMaxParticles; 112 int rainWindForce; 113 bool rainMove; 114 bool rainActivate; 106 115 107 float soundRainVolume; 116 OrxSound::SoundSource soundSource; 117 OrxSound::SoundBuffer* rainBuffer; 118 OrxSound::SoundBuffer* windBuffer; 108 119 109 LightManager* lightMan; 110 GLfloat rainAmbient; 120 float soundRainVolume; 121 122 LightManager* lightMan; 123 GLfloat rainAmbient; 111 124 112 125 };
Note: See TracChangeset
for help on using the changeset viewer.