1 | /** |
---|
2 | * @file lightening_effect.h |
---|
3 | */ |
---|
4 | |
---|
5 | #ifndef _LIGHTENING_EFFECT |
---|
6 | #define _LIGHTENING_EFFECT |
---|
7 | |
---|
8 | #include "vector.h" |
---|
9 | #include "vector2D.h" |
---|
10 | |
---|
11 | #include "weather_effect.h" |
---|
12 | |
---|
13 | #include "sound_buffer.h" |
---|
14 | #include "sound_source.h" |
---|
15 | |
---|
16 | |
---|
17 | class Billboard; |
---|
18 | |
---|
19 | class LighteningEffect : public WeatherEffect |
---|
20 | { |
---|
21 | public: |
---|
22 | LighteningEffect(const TiXmlElement* root = NULL); |
---|
23 | virtual ~LighteningEffect(); |
---|
24 | |
---|
25 | virtual void loadParams(const TiXmlElement* root); |
---|
26 | |
---|
27 | virtual bool init(); |
---|
28 | |
---|
29 | virtual bool activate(); |
---|
30 | virtual bool deactivate(); |
---|
31 | |
---|
32 | virtual void draw() const; |
---|
33 | virtual void tick(float dt); |
---|
34 | |
---|
35 | void coord(float x, float y, float z); |
---|
36 | |
---|
37 | inline void setLighteningOption(const std::string& option) { if (option == "activate") this->lighteningActivate = true; |
---|
38 | /*if (option == "activate") this->snowActivate = true; */} |
---|
39 | |
---|
40 | void activateLightening() { this->activate(); } |
---|
41 | void deactivateLightening() { this->deactivate(); } |
---|
42 | |
---|
43 | private: |
---|
44 | Billboard* billboard; |
---|
45 | bool lighteningActivate; |
---|
46 | |
---|
47 | float flashFrequency; //!< frequency to activate itself |
---|
48 | float flashRisingTime; //!< time to rise |
---|
49 | float flashConstTime; //!< time to be drawn |
---|
50 | float flashFallTime; //!< time to fall |
---|
51 | |
---|
52 | float time; //!< time |
---|
53 | |
---|
54 | //bool bRender; |
---|
55 | bool bNewCoordinate; |
---|
56 | //Material* material; |
---|
57 | //Vector offset; |
---|
58 | float width; |
---|
59 | float height; |
---|
60 | |
---|
61 | float seedX; |
---|
62 | float seedZ; |
---|
63 | float seedTime; |
---|
64 | |
---|
65 | float mainPosX; |
---|
66 | float mainPosY; |
---|
67 | float mainPosZ; |
---|
68 | |
---|
69 | //OrxSound::SoundSource soundSource; |
---|
70 | //OrxSound::SoundBuffer* thunderBuffer; |
---|
71 | |
---|
72 | }; |
---|
73 | |
---|
74 | #endif /* _LIGHTENING_EFFECT */ |
---|