Changeset 8702 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
- Timestamp:
- Jun 22, 2006, 11:12:05 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
r8700 r8702 1 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 4 4 Copyright (C) 2004 orx 5 5 6 6 This program is free software; you can redistribute it and/or modify 7 7 it under the terms of the GNU General Public License as published by 8 8 the Free Software Foundation; either version 2, or (at your option) 9 9 any later version. 10 10 11 11 ### File Specific: 12 12 main-programmer: hdavid, amaechler … … 35 35 36 36 CREATE_FACTORY(LighteningEffect, CL_LIGHTENING_EFFECT); 37 38 // TODO: FIx Lightening with Fog enabled39 37 40 38 LighteningEffect::LighteningEffect(const TiXmlElement* root) … … 80 78 this->lighteningActivate = false; 81 79 82 this-> time = 0.0;83 this->flashFrequency = 4.0f;84 this->mainFrequency = 4.0f; 85 this->flash ConstTime = 0.1f;80 this->flashFrequencyBase = 2.0f; 81 this->flashFrequencySeed = 4.0f; 82 83 this->flashHoldTime = 0.1f; 86 84 this->flashRisingTime = 0.03f; 85 86 this->seedX = 500.f; 87 this->seedZ = 1000.0f; 87 88 88 89 this->width = 700.0f; … … 90 91 this->seedWidth = 50.0f; 91 92 this->seedHeight = 50.0f; 92 this->bNewCoordinate = false; 93 93 94 this->lighteningMove = false; 94 95 95 this->seedX = 500.f; 96 this->seedZ = 1000.0f; 97 this->seedTime = 2.0f; 98 99 this->mainPosX = 3000; 96 this->mainPosX = 2000; 100 97 this->mainPosY = 900; 101 98 this->mainPosZ = 0; 99 100 this->time = 0.0; 102 101 103 102 // initialize lightening textures … … 142 141 this->flashLight->setSpecularColor(0,0,0); 143 142 144 // this->soundSource = NULL;145 // this->thunderBuffer = NULL;146 147 // this->soundSource.setSourceNode(this);148 149 143 //load sound 150 144 if (this->thunderBuffer != NULL) 151 145 ResourceManager::getInstance()->unload(this->thunderBuffer); 152 this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder. wav", WAV);146 this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder.ogg", OGG); 153 147 154 148 } … … 252 246 this->billboard[1]->setVisibiliy(false); 253 247 this->billboard[2]->setVisibiliy(true); 254 248 255 249 } 256 250 else if( this->billboard[2]->isVisible() && this->time > this->flashRisingTime) … … 260 254 } 261 255 262 if( this->billboard[3]->isVisible() && this->time > this->flash ConstTime)256 if( this->billboard[3]->isVisible() && this->time > this->flashHoldTime) 263 257 { 264 258 this->billboard[3]->setVisibiliy(false); … … 266 260 this->flashLight->setDiffuseColor(0,0,0); 267 261 this->flashLight->setSpecularColor(0,0,0); 268 this->bNewCoordinate = true; 269 } 270 271 if( this->bNewCoordinate) 272 { 262 263 this->newCoordinates(); 264 } 265 } 266 267 void LighteningEffect::newCoordinates() { 268 273 269 float posX, posZ; 274 270 … … 294 290 this->billboard[3]->setAbsCoor(posX, this->mainPosY, posZ); 295 291 296 this->flashFrequency = this-> mainFrequency + this->seedTime* (float)rand()/(float)RAND_MAX;292 this->flashFrequency = this->flashFrequencyBase + this->flashFrequencySeed * (float)rand()/(float)RAND_MAX; 297 293 298 294 float w = this->width + this->seedWidth * (float)rand()/(float)RAND_MAX; … … 303 299 this->billboard[2]->setSize(w, h); 304 300 this->billboard[3]->setSize(w, h); 305 306 this->bNewCoordinate = false; 307 } 308 } 301 }
Note: See TracChangeset
for help on using the changeset viewer.