Changeset 9686 in orxonox.OLD for branches/new_class_id/src/lib/graphics/effects/lightning_effect.h
- Timestamp:
- Aug 22, 2006, 2:36:54 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/effects/lightning_effect.h
r9006 r9686 17 17 class Light; 18 18 19 class LightningEffect : public WeatherEffect { 19 class LightningEffect : public WeatherEffect 20 { 21 NewObjectListDeclaration(LightningEffect); 20 22 public: 21 22 23 LightningEffect(const TiXmlElement* root = NULL); 24 virtual ~LightningEffect(); 23 25 24 26 virtual void loadParams(const TiXmlElement* root); 25 27 26 28 virtual void init(); 27 29 28 29 30 virtual void activate(); 31 virtual void deactivate(); 30 32 31 inline void activateLightning() { 32 this->activate(); 33 } 34 inline void deactivateLightning() { 35 this->deactivate(); 36 } 33 inline void activateLightning() 34 { 35 this->activate(); 36 } 37 inline void deactivateLightning() 38 { 39 this->deactivate(); 40 } 37 41 38 42 virtual void tick(float dt); 39 43 40 41 44 void coord(float x, float y, float z); 45 void setFlashSize(float width, float height, float seedWidth, float seedHeight); 42 46 43 inline void setLightningOption(const std::string& option) { 44 if (option == "activate") 45 this->lightningActivate = true; 46 if (option == "movelightning") 47 this->lightningMove = true; 48 } 47 inline void setLightningOption(const std::string& option) 48 { 49 if (option == "activate") 50 this->lightningActivate = true; 51 if (option == "movelightning") 52 this->lightningMove = true; 53 } 49 54 50 inline void setFlashFrequency(float baseFrequency, float seedTime) { 51 this->flashFrequencyBase = baseFrequency; 52 this->flashFrequency = baseFrequency; 53 this->flashFrequencySeed = seedTime; 54 } 55 inline void setFlashFrequency(float baseFrequency, float seedTime) 56 { 57 this->flashFrequencyBase = baseFrequency; 58 this->flashFrequency = baseFrequency; 59 this->flashFrequencySeed = seedTime; 60 } 55 61 56 inline void setFlashConstTime(float holdTime) { 57 this->flashHoldTime = holdTime; 58 } 62 inline void setFlashConstTime(float holdTime) 63 { 64 this->flashHoldTime = holdTime; 65 } 59 66 60 inline void setFlashRisingTime(float flashRisingTime) { 61 if(flashRisingTime > this->flashHoldTime) 62 this->flashRisingTime = this->flashHoldTime * 0.5; 63 else 64 this->flashRisingTime = flashRisingTime; 65 } 67 inline void setFlashRisingTime(float flashRisingTime) 68 { 69 if(flashRisingTime > this->flashHoldTime) 70 this->flashRisingTime = this->flashHoldTime * 0.5; 71 else 72 this->flashRisingTime = flashRisingTime; 73 } 66 74 67 inline void setFlashSeed(float seedX, float seedZ) { 68 this->seedX = seedX; 69 this->seedZ = seedZ; 70 } 75 inline void setFlashSeed(float seedX, float seedZ) 76 { 77 this->seedX = seedX; 78 this->seedZ = seedZ; 79 } 71 80 72 81 73 82 private: 74 83 75 76 77 84 void newCoordinates(); 85 void setTexture(); 86 void switchTexture(); 78 87 79 80 88 Billboard* thunderBolt[4]; 89 bool thunderTextureA; 81 90 82 83 91 bool lightningActivate; 92 bool lightningMove; 84 93 85 86 87 88 94 float flashFrequency; 95 float flashFrequencyBase; 96 float flashHoldTime; 97 float flashRisingTime; 89 98 90 99 float time; 91 100 92 93 94 95 101 float width; 102 float height; 103 float seedWidth; 104 float seedHeight; 96 105 97 98 99 106 float seedX; 107 float seedZ; 108 float flashFrequencySeed; 100 109 101 102 103 110 float mainPosX; 111 float mainPosY; 112 float mainPosZ; 104 113 105 106 114 Vector origSkyColor; 115 Vector cameraCoor; 107 116 108 117 Light* flashLight; 109 118 110 111 119 OrxSound::SoundSource soundSource; 120 OrxSound::SoundBuffer* thunderBuffer; 112 121 113 122 };
Note: See TracChangeset
for help on using the changeset viewer.