Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

branches/atmospheric_engine: cool light effect for the lightening

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