Changeset 8702 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics
- Timestamp:
- Jun 22, 2006, 11:12:05 AM (18 years ago)
- Location:
- branches/atmospheric_engine/src/lib/graphics/effects
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
r8700 r8702 122 122 123 123 // If Fog Fade 124 if ( this->fogFadeInActivate || this->fogFadeOutActivate ) 125 glFogf(GL_FOG_DENSITY, this->fogFadeDensity); 126 124 if ( this->fogFadeInActivate || this->fogFadeOutActivate ) { 125 glDisable(GL_FOG); 126 glFogf(GL_FOG_DENSITY, this->fogFadeDensity); 127 glEnable(GL_FOG); 128 } 127 129 } 128 130 -
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 } -
branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.h
r8700 r8702 34 34 35 35 virtual void tick(float dt); 36 36 37 37 void coord(float x, float y, float z); 38 38 void setFlashSize(float width, float height, float seedWidth, float seedHeight); 39 39 40 40 inline void setLighteningOption(const std::string& option) { 41 41 if (option == "activate") this->lighteningActivate = true; … … 43 43 } 44 44 45 inline void setFlashFrequency(float mainFrequency, float seedTime) {46 this-> mainFrequency = mainFrequency;47 this->flashFrequency = mainFrequency;48 this-> seedTime= seedTime;45 inline void setFlashFrequency(float baseFrequency, float seedTime) { 46 this->flashFrequencyBase = baseFrequency; 47 this->flashFrequency = baseFrequency; 48 this->flashFrequencySeed = seedTime; 49 49 } 50 51 inline void setFlashConstTime(float flashConstTime) { this->flashConstTime = flashConstTime; }50 51 inline void setFlashConstTime(float holdTime) { this->flashHoldTime = holdTime; } 52 52 53 53 inline void setFlashRisingTime(float flashRisingTime) { 54 if(flashRisingTime > this->flash ConstTime)55 this->flashRisingTime = this->flash ConstTime/2;54 if(flashRisingTime > this->flashHoldTime) 55 this->flashRisingTime = this->flashHoldTime * 0.5; 56 56 else 57 57 this->flashRisingTime = flashRisingTime; 58 58 } 59 59 60 60 inline void setFlashSeed(float seedX, float seedZ) { 61 61 this->seedX = seedX; 62 62 this->seedZ = seedZ; 63 63 } 64 64 65 65 66 66 private: … … 68 68 bool lighteningActivate; 69 69 bool lighteningMove; 70 70 71 71 float flashFrequency; 72 float mainFrequency;73 float flash ConstTime;72 float flashFrequencyBase; 73 float flashHoldTime; 74 74 float flashRisingTime; 75 75 76 76 float time; 77 78 bool flashingActive;79 bool bNewCoordinate;80 77 81 78 float width; … … 83 80 float seedWidth; 84 81 float seedHeight; 85 82 86 83 float seedX; 87 84 float seedZ; 88 float seedTime;89 85 float flashFrequencySeed; 86 90 87 float mainPosX; 91 88 float mainPosY; 92 89 float mainPosZ; 93 90 91 void newCoordinates(); 92 94 93 Vector cameraCoor; 95 94 96 95 Light* flashLight; 97 96 98 97 OrxSound::SoundSource soundSource; 99 98 OrxSound::SoundBuffer* thunderBuffer; -
branches/atmospheric_engine/src/lib/graphics/effects/rain_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 … … 57 57 if (this->rainBuffer != NULL) 58 58 ResourceManager::getInstance()->unload(this->rainBuffer); 59 this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/rain. wav", WAV);59 this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/rain.ogg", OGG); 60 60 61 61 //load wind sound … … 63 63 if (this->windBuffer != NULL) 64 64 ResourceManager::getInstance()->unload(this->windBuffer); 65 this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind. wav", WAV);65 this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.ogg", OGG); 66 66 } 67 67 -
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc
r8495 r8702 50 50 if (this->windBuffer != NULL) 51 51 ResourceManager::getInstance()->unload(this->windBuffer); 52 this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind. wav", WAV);52 this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.ogg", OGG); 53 53 } 54 54 … … 56 56 this->activate(); 57 57 SnowEffect::snowParticles->precache((int) this->snowLife); 58 } 58 } 59 59 } 60 60 … … 143 143 if (this->snowWindForce != 0) 144 144 this->soundSource.play(this->windBuffer, 0.1f * this->snowWindForce, true); 145 145 146 146 } 147 147
Note: See TracChangeset
for help on using the changeset viewer.