Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

branches/atmospheric_engine

File size: 2.8 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;
18class Light;
19
20class LighteningEffect : public WeatherEffect
21{
22        public:
23                LighteningEffect(const TiXmlElement* root = NULL);
24                virtual ~LighteningEffect();
25
26                virtual void loadParams(const TiXmlElement* root);
27
28                virtual bool init();
29
30                virtual bool activate();
31                virtual bool deactivate();
32
33    virtual void draw() const;
34    virtual void tick(float dt);
35   
36    void coord(float x, float y, float z);
37    void setFlashSize(float width, float height, float seedWidth, float seedHeight);
38   
39    inline void setLighteningOption(const std::string& option) { if (option == "activate") this->lighteningActivate = true;
40                                                                                         if (option == "movelightening") this->lighteningMove = true;}
41    inline void setFlashFrequency(float mainFrequency, float seedTime) { this->mainFrequency = mainFrequency;
42                                                                                                            this->flashFrequency = mainFrequency;
43                                                                                                            this->seedTime = seedTime; }
44    inline void setFlashConstTime(float flashConstTime) { this->flashConstTime = flashConstTime; }
45    inline void setFlashRisingTime(float flashRisingTime) { if(flashRisingTime > this->flashConstTime)
46                                                                                        this->flashRisingTime = this->flashConstTime/2;
47                                                                                      else
48                                                                                        this->flashRisingTime = flashRisingTime; }
49    inline void setFlashSeed(float seedX, float seedZ) { this->seedX = seedX;
50                                                                                  this->seedZ = seedZ; }
51
52    void activateLightening() { this->activate(); }
53    void deactivateLightening() { this->deactivate(); }
54   
55        private:
56    Billboard* billboard[4];
57    bool lighteningActivate;
58    bool lighteningMove;
59
60    float flashFrequency;
61    float mainFrequency;
62    float flashConstTime;
63    float flashRisingTime;
64
65    float time;
66
67    bool  bNewCoordinate;
68    float width;
69    float height;
70    float seedWidth;
71    float seedHeight;
72
73    float seedX;
74    float seedZ;
75    float seedTime;
76   
77    float mainPosX;
78    float mainPosY;
79    float mainPosZ;
80   
81    Vector cameraCoor;
82
83    Light* flashLight;
84   
85    //OrxSound::SoundSource    soundSource;
86    //OrxSound::SoundBuffer*   thunderBuffer;
87
88};
89
90#endif  /* _LIGHTENING_EFFECT */
Note: See TracBrowser for help on using the repository browser.