Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h @ 8242

Last change on this file since 8242 was 8223, checked in by hdavid, 18 years ago

branches/atmospheric_enc_engine: starting implementation of random raising for the lightening

File size: 2.4 KB
Line 
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
17class Billboard;
18
19class 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    inline void setFlashFrequency(float flashFrequency) { this->flashFrequency = flashFrequency; }
39    inline void setFlashConstTime(float flashConstTime) { this->flashConstTime = flashConstTime; }
40    inline void setFlashRisingTime(float flashRisingTime) { if(flashRisingTime > this->flashConstTime)
41                                                              this->flashRisingTime = this->flashConstTime/2;
42                                                            else
43                                                              this->flashRisingTime = flashRisingTime; }
44    inline void setFlashSize(float width, float height) { this->width = width;
45                                                          this->height = height; }
46    inline void setFlashSeed(float seedX, float seedZ, float seedTime) { this->seedX = seedX;
47                                                                         this->seedZ = seedZ;
48                                                                         this->seedTime = seedTime; }
49
50    void activateLightening() { this->activate(); }
51    void deactivateLightening() { this->deactivate(); }
52   
53        private:
54    Billboard* billboard[4];
55    bool lighteningActivate;
56    int lightening1;
57    int lightening2;
58    int lightening3;
59
60    float flashFrequency;
61    float flashConstTime;
62    float flashRisingTime;
63
64    float time;
65
66    bool  bNewCoordinate;
67    float width;
68    float height;
69
70    float seedX;
71    float seedZ;
72    float seedTime;
73   
74    float mainPosX;
75    float mainPosY;
76    float mainPosZ;
77
78    //OrxSound::SoundSource    soundSource;
79    //OrxSound::SoundBuffer*   thunderBuffer;
80
81};
82
83#endif  /* _LIGHTENING_EFFECT */
Note: See TracBrowser for help on using the repository browser.