| Rev | Line |   | 
|---|
| [6741] | 1 | /** | 
|---|
| [7810] | 2 | * @file fog_effect.h | 
|---|
 | 3 | */ | 
|---|
| [6741] | 4 |  | 
|---|
 | 5 | #ifndef _FOG_EFFECT | 
|---|
 | 6 | #define _FOG_EFFECT | 
|---|
 | 7 |  | 
|---|
| [7107] | 8 | #include "vector.h" | 
|---|
| [6741] | 9 |  | 
|---|
| [7810] | 10 | #include "weather_effect.h" | 
|---|
| [6741] | 11 |  | 
|---|
| [7810] | 12 | class FogEffect : public WeatherEffect | 
|---|
| [6741] | 13 | { | 
|---|
| [7810] | 14 |         public: | 
|---|
 | 15 |                 FogEffect(const TiXmlElement* root = NULL); | 
|---|
 | 16 |                 virtual ~FogEffect(); | 
|---|
| [6741] | 17 |  | 
|---|
| [7810] | 18 |                 virtual void loadParams(const TiXmlElement* root); | 
|---|
| [6741] | 19 |  | 
|---|
| [7810] | 20 |                 virtual bool init(); | 
|---|
| [6741] | 21 |  | 
|---|
| [7810] | 22 |                 virtual bool activate(); | 
|---|
 | 23 |                 virtual bool deactivate(); | 
|---|
| [6772] | 24 |  | 
|---|
| [8255] | 25 |                 void activateFog() { this->activate(); } | 
|---|
 | 26 |                 void deactivateFog() { this->deactivate(); } | 
|---|
 | 27 |  | 
|---|
 | 28 |                 virtual void draw() const; | 
|---|
 | 29 |                 virtual void tick(float dt); | 
|---|
 | 30 |  | 
|---|
| [7810] | 31 |                 inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); } | 
|---|
 | 32 |                 inline void setFogDensity(float density) { this->fogDensity = density; } | 
|---|
 | 33 |                 inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; } | 
|---|
 | 34 |                 inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); } | 
|---|
| [8255] | 35 |                 inline void setFogOption(const std::string& option) { if (option == "activate") this->fogActivate = true; } | 
|---|
| [6772] | 36 |  | 
|---|
| [8255] | 37 |                 void startFogging(); | 
|---|
 | 38 |  | 
|---|
| [7810] | 39 |         private: | 
|---|
 | 40 |                 GLint stringToFogMode(const std::string& mode); | 
|---|
| [6772] | 41 |  | 
|---|
| [8255] | 42 |                 bool                            fogActivate; | 
|---|
 | 43 |                 GLfloat                         fogFadeDuration; | 
|---|
 | 44 |                 float                           localTimer; | 
|---|
 | 45 |                  | 
|---|
 | 46 |                 GLint                           fogMode; | 
|---|
 | 47 |                 GLfloat                         fogDensity; | 
|---|
 | 48 |                 GLfloat                         fogFadeDensity; | 
|---|
 | 49 |  | 
|---|
 | 50 |                 GLfloat                         fogStart; | 
|---|
 | 51 |                 GLfloat                         fogEnd; | 
|---|
 | 52 |                 Vector                          colorVector; | 
|---|
| [6741] | 53 | }; | 
|---|
 | 54 |  | 
|---|
 | 55 |  | 
|---|
| [7810] | 56 | #endif  /* _FOG_EFFECT */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.