Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h @ 8444

Last change on this file since 8444 was 8443, checked in by amaechler, 18 years ago

branches/atmospheric_engine: fade work

File size: 1.6 KB
Line 
1/**
2* @file fog_effect.h
3*/
4
5#ifndef _FOG_EFFECT
6#define _FOG_EFFECT
7
8#include "vector.h"
9
10#include "weather_effect.h"
11
12class FogEffect : public WeatherEffect
13{
14        public:
15                FogEffect(const TiXmlElement* root = NULL);
16                virtual ~FogEffect();
17
18                virtual void loadParams(const TiXmlElement* root);
19
20                virtual bool init();
21
22                virtual bool activate();
23                virtual bool deactivate();
24
25                void activateFog() { this->activate(); }
26                void deactivateFog() { this->deactivate(); }
27
28                virtual void draw() const;
29                virtual void tick(float dt);
30
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); }
35                inline void setFogFadeIn(float fadein) { this->fogFadeInDuration = fadein; }
36                inline void setFogFadeOut(float fadeout) { this->fogFadeOutDuration = fadeout; }
37
38                inline void setFogOption(const std::string& option) { if (option == "activate") this->fogActivate = true; }
39
40                void fadeInFog();
41                void fadeOutFog();
42
43
44        private:
45                GLint stringToFogMode(const std::string& mode);
46
47                bool                            fogActivate;
48
49                bool                            fogFadeInActivate;
50                bool                            fogFadeOutActivate;
51
52                GLfloat                         fogFadeInDuration;
53                GLfloat                         fogFadeOutDuration;
54
55                float                           localTimer;
56               
57                GLint                           fogMode;
58                GLfloat                         fogDensity;
59                GLfloat                         fogFadeInDensity;
60                GLfloat                         fogFadeOutDensity;
61
62                GLfloat                         fogStart;
63                GLfloat                         fogEnd;
64                Vector                          colorVector;
65};
66
67
68#endif  /* _FOG_EFFECT */
Note: See TracBrowser for help on using the repository browser.