/** * @file lightening_effect.h */ #ifndef _LIGHTENING_EFFECT #define _LIGHTENING_EFFECT #include "vector.h" #include "vector2D.h" #include "weather_effect.h" #include "sound_buffer.h" #include "sound_source.h" class Billboard; class Light; class LighteningEffect : public WeatherEffect { public: LighteningEffect(const TiXmlElement* root = NULL); virtual ~LighteningEffect(); virtual void loadParams(const TiXmlElement* root); virtual bool init(); virtual bool activate(); virtual bool deactivate(); virtual void draw() const; virtual void tick(float dt); void coord(float x, float y, float z); void setFlashSize(float width, float height, float seedWidth, float seedHeight); inline void setLighteningOption(const std::string& option) { if (option == "activate") this->lighteningActivate = true;} inline void setFlashFrequency(float flashFrequency) { this->flashFrequency = flashFrequency; } inline void setFlashConstTime(float flashConstTime) { this->flashConstTime = flashConstTime; } inline void setFlashRisingTime(float flashRisingTime) { if(flashRisingTime > this->flashConstTime) this->flashRisingTime = this->flashConstTime/2; else this->flashRisingTime = flashRisingTime; } inline void setFlashSeed(float seedX, float seedZ, float seedTime) { this->seedX = seedX; this->seedZ = seedZ; this->seedTime = seedTime; } void activateLightening() { this->activate(); } void deactivateLightening() { this->deactivate(); } private: Billboard* billboard[4]; bool lighteningActivate; float flashFrequency; float flashConstTime; float flashRisingTime; float time; bool bNewCoordinate; float width; float height; float seedWidth; float seedHeight; float seedX; float seedZ; float seedTime; float mainPosX; float mainPosY; float mainPosZ; Light* flashLight; //OrxSound::SoundSource soundSource; //OrxSound::SoundBuffer* thunderBuffer; }; #endif /* _LIGHTENING_EFFECT */