Changeset 8251 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
- Timestamp:
- Jun 8, 2006, 3:15:59 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
r8223 r8251 74 74 this->flashRisingTime = 0.5f; 75 75 76 this->width = 40.0f; 77 this->height = 10.0f; 76 this->width = 400.0f; 77 this->height = 100.0f; 78 this->seedWidth = 5; 79 this->seedHeight = 5; 78 80 this->bNewCoordinate = false; 79 81 … … 81 83 this->seedZ = 10.0f; 82 84 this->seedTime = 4.0f; 83 84 lightening1 = 1;85 lightening2 = 2;86 lightening3 = 3;87 85 88 86 this->billboard[0] = new Billboard(NULL); … … 130 128 this->mainPosY = y; 131 129 this->mainPosZ = z; 132 133 } 130 } 131 132 133 void LighteningEffect::setFlashSize(float width, float height, float seedWidth, float seedHeight) 134 { 135 this->width = width; 136 this->height = height; 137 this->seedWidth = seedWidth; 138 this->seedHeight = seedHeight; 139 this->billboard[0]->setSize(this->width, this->height); 140 this->billboard[1]->setSize(this->width, this->height); 141 this->billboard[2]->setSize(this->width, this->height); 142 this->billboard[3]->setSize(this->width, this->height); 143 } 144 134 145 135 146 bool LighteningEffect::activate() … … 158 169 this->time += dt; 159 170 171 /*if( flashLight != NULL) 172 { 173 if((int)(100*time)%2) 174 this->flashLight->setDiffuseColor(0,0,0); 175 else 176 this->flashLight->setDiffuseColor(100,100,100); 177 178 //PRINTF(0)("100*time: %f %i\n", 100*time, (int)(100*time)); 179 }*/ 180 160 181 if( this->time > this->flashFrequency) 161 182 { 162 183 this->billboard[0]->setVisibiliy(true); 163 184 this->time = 0.0f; 185 186 this->flashLight = new Light(); 187 this->flashLight->setAbsCoor(this->billboard[0]->getAbsCoor().x, this->billboard[0]->getAbsCoor().y, this->billboard[0]->getAbsCoor().z); 188 this->flashLight->setDiffuseColor(100,100,100); 189 164 190 //this->soundSource.play(this->thunderBuffer); 165 191 } 166 else if( this->billboard[ lightening3]->isVisible() && this->time > this->flashConstTime)167 { 168 this->billboard[ lightening3]->setVisibiliy(false);192 else if( this->billboard[3]->isVisible() && this->time > this->flashConstTime) 193 { 194 this->billboard[3]->setVisibiliy(false); 169 195 this->time = 0.0f; 170 196 this->bNewCoordinate = true; 171 } 172 173 if( this->billboard[lightening2]->isVisible() && this->time > this->flashRisingTime) 174 { 175 this->billboard[lightening2]->setVisibiliy(false); 176 this->billboard[lightening3]->setVisibiliy(true); 177 } 178 else if( this->billboard[lightening1]->isVisible() && this->time > this->flashRisingTime*2/3 ) 179 { 180 this->billboard[lightening1]->setVisibiliy(false); 181 this->billboard[lightening2]->setVisibiliy(true); 197 198 if(flashLight != NULL) 199 { 200 delete this->flashLight; 201 flashLight = NULL; 202 } 203 } 204 205 if( this->billboard[2]->isVisible() && this->time > this->flashRisingTime) 206 { 207 this->billboard[2]->setVisibiliy(false); 208 this->billboard[3]->setVisibiliy(true); 209 //this->flashLight->setDiffuseColor(0,0,0); 210 } 211 else if( this->billboard[1]->isVisible() && this->time > this->flashRisingTime*2/3 ) 212 { 213 this->billboard[1]->setVisibiliy(false); 214 this->billboard[2]->setVisibiliy(true); 215 // this->flashLight->setDiffuseColor(0,0,0); 182 216 } 183 217 else if( this->billboard[0]->isVisible() && this->time > this->flashRisingTime*1/3 ) 184 218 { 185 219 this->billboard[0]->setVisibiliy(false); 186 this->billboard[lightening1]->setVisibiliy(true); 220 this->billboard[1]->setVisibiliy(true); 221 // this->flashLight->setDiffuseColor(100,100,100); 187 222 } 188 223 … … 194 229 this->billboard[1]->setAbsCoor(posX, this->mainPosY, posZ); 195 230 this->billboard[2]->setAbsCoor(posX, this->mainPosY, posZ); 196 this->billboard[3]->setAbsCoor(posX, this->mainPosY, posZ); 231 this->billboard[3]->setAbsCoor(posX, this->mainPosY, posZ); 197 232 this->bNewCoordinate = false; 198 233 } … … 201 236 void LighteningEffect::draw() const 202 237 { 203 /*if(!this->billboard->isVisible()) 204 return; 205 206 LightManager* lightMan = LightManager::getInstance(); 207 208 (new Light())->setAbsCoor(this->billboard->getAbsCoor().x, this->billboard->getAbsCoor().y, this->billboard->getAbsCoor().z); 209 (new Light())->setDiffuseColor(1,1,1); 210 LightManager::getInstance()->draw(); 211 212 delete lightMan;*/ 213 } 238 }
Note: See TracChangeset
for help on using the changeset viewer.