Changeset 8050 in orxonox.OLD for branches/atmospheric_engine
- Timestamp:
- May 31, 2006, 11:45:41 PM (19 years ago)
- Location:
- branches/atmospheric_engine/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
r8026 r8050 31 31 this->setClassID(CL_LIGHTENING_EFFECT, "LighteningEffect"); 32 32 33 34 billboard = new Billboard(NULL);35 billboard->setTexture("maps/lightning_bolt.png");36 billboard->setSize(10, 20);37 //billboard->setAbsCoor2D(10,10);38 //billboard->setVisibility(true);39 40 41 33 this->init(); 42 34 … … 60 52 bool LighteningEffect::init() 61 53 { 62 //Default values 54 this->time = 0.0; 55 this->flashFrequency = 0.6f; 56 this->flashConstTime = 0.07f; 57 58 //this->material = new Material(); 59 //this->material->setDiffuseMap("maps/lightning_bolt.png"); 60 //this->offset = Vector(-1440.00, 100.00, 280.00); 61 62 // this->billboard->setAbsCoor(50, 0, 0); 63 this->width = 20.0f; 64 this->height = 5.0f; 65 this->bNewCoordinate = false; 66 67 this->seedX = 20.f; 68 this->seedZ = 50.0f; 69 this->seedTime = 4.0f; 70 71 this->billboard = new Billboard(NULL); 72 this->billboard->setTexture("maps/lightning_bolt.png"); 73 this->billboard->setSize(this->width, this->height); 74 this->billboard->setAbsCoor(50, 0, 0); 75 this->billboard->setVisibiliy(false); 76 //this->billboard->setAbsCoor(50, 0, 0); 77 //this->billboard->setVisibiliy(true); 78 79 /* 80 this->soundSource = NULL; 81 this->thunderBuffer = NULL; 82 83 this->soundSource.setSourceNode(this); 84 85 //load sound 86 if (this->thunderBuffer != NULL) 87 ResourceManager::getInstance()->unload(this->thunderBuffer); 88 this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/thunder.wav", WAV);*/ 63 89 } 64 90 … … 78 104 void LighteningEffect::tick (float dt) 79 105 { 106 this->time += dt; 80 107 108 if( this->time > this->flashFrequency) 109 { 110 this->billboard->setVisibiliy(true); 111 this->time = 0.0f; 112 //this->soundSource.play(this->thunderBuffer); 113 } 114 else if( this->billboard->isVisible() && this->time > this->flashConstTime) 115 { 116 this->billboard->setVisibiliy(false); 117 this->time = 0.0f; 118 this->bNewCoordinate = true; 119 } 120 121 if( this->bNewCoordinate) 122 { 123 //this->flashFrequency = this->seedTime * (float)rand()/(float)RAND_MAX + 0.1; 124 //this->billboard>setAbsCoor( - 800.0f - this->seedX * (float)rand()/(float)RAND_MAX, 250.00, -200.0f + this->seedZ * (float)rand()/(float)RAND_MAX); 125 this->bNewCoordinate = false; 126 } 81 127 } -
branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h
r7951 r8050 35 35 Billboard* billboard; 36 36 37 float flashFrequency; //!< frequency to activate itself 38 float flashRisingTime; //!< time to rise 39 float flashConstTime; //!< time to be drawn 40 float flashFallTime; //!< time to fall 41 42 float time; //!< time 43 44 //bool bRender; 45 bool bNewCoordinate; 46 //Material* material; 47 //Vector offset; 48 float width; 49 float height; 50 51 float seedX; 52 float seedZ; 53 float seedTime; 54 55 //OrxSound::SoundSource soundSource; 56 //OrxSound::SoundBuffer* thunderBuffer; 57 37 58 }; 38 59 -
branches/atmospheric_engine/src/world_entities/effects/billboard.cc
r8026 r8050 64 64 this->material = new Material(); 65 65 this->setAbsCoor(0, 0, 0); 66 this->setVisibiliy(true);66 //this->setVisibiliy(true); 67 67 this->setSize(5, 5); 68 68 } … … 140 140 v.normalize(); 141 141 142 float radius = 5; 143 v *= .5 * sizeX; 144 h *= .5 * sizeY; 145 142 v *= sizeX; 143 h *= sizeY; 144 145 //v += this->getAbsCoor(); 146 //PRINTF(0)("sizeX: %f sizeY: %f\n", sizeX, sizeY); 146 147 glBegin(GL_QUADS); 147 148 glTexCoord2f(0.0f, 0.0f);
Note: See TracChangeset
for help on using the changeset viewer.