Changeset 8716 in orxonox.OLD for branches/atmospheric_engine/src
- Timestamp:
- Jun 22, 2006, 1:57:16 PM (18 years ago)
- Location:
- branches/atmospheric_engine/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
r8704 r8716 78 78 this->fogFadeOutDuration = 0; 79 79 this->fogFadeDensity = 0; 80 this->fogFadeEnd = 0; 81 80 82 this->localTimer = 0; 81 83 this->fogActivate = false; … … 123 125 // If Fog Fade 124 126 if ( this->fogFadeInActivate || this->fogFadeOutActivate ) { 125 glDisable(GL_FOG); 126 127 GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0}; 128 glFogi(GL_FOG_MODE, this->fogMode); 129 glFogfv(GL_FOG_COLOR, fogColor); 130 glHint(GL_FOG_HINT, GL_DONT_CARE); 131 glFogf(GL_FOG_DENSITY, this->fogFadeDensity); 132 glFogf(GL_FOG_START, this->fogStart); 133 glFogf(GL_FOG_END, this->fogEnd); 134 135 glEnable(GL_FOG); 127 if ( this->fogMode == GL_LINEAR) 128 glFogf(GL_FOG_END, this->fogFadeEnd); 129 else 130 glFogf(GL_FOG_DENSITY, this->fogFadeDensity); 136 131 } 137 132 } … … 144 139 if ( this->fogFadeInActivate ) { 145 140 this->localTimer += dt; 146 this->fogFadeDensity = ( this->localTimer / this->fogFadeInDuration ) * this->fogDensity; 147 148 if ( this->localTimer >= this->fogFadeOutDuration ) 141 142 if ( this->fogMode == GL_LINEAR) 143 this->fogFadeEnd = 2000 * (1 - ( this->localTimer / this->fogFadeInDuration )) + this->fogEnd; 144 else 145 this->fogFadeDensity = ( this->localTimer / this->fogFadeInDuration ) * this->fogDensity; 146 147 if ( this->localTimer >= this->fogFadeInDuration ) 149 148 this->fogFadeInActivate = false; 150 149 } … … 152 151 if ( this->fogFadeOutActivate ) { 153 152 this->localTimer += dt; 154 this->fogFadeDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity); 153 154 if ( this->fogMode == GL_LINEAR) 155 this->fogFadeEnd = 2000 * ( this->localTimer / this->fogFadeInDuration ) + this->fogEnd; 156 else 157 this->fogFadeDensity = 1 - (( this->localTimer / this->fogFadeInDuration ) * this->fogDensity); 155 158 156 159 if ( this->localTimer >= this->fogFadeOutDuration ) … … 175 178 this->localTimer = 0; 176 179 180 // Activate Fog 181 this->activate(); 182 177 183 // set FogFadeIn activate 178 184 this->fogFadeInActivate = true; 179 180 // Activate Fog181 this->activate();182 185 183 186 } -
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h
r8700 r8716 89 89 GLfloat fogStart; 90 90 GLfloat fogEnd; 91 GLfloat fogFadeEnd; 92 91 93 Vector colorVector; 92 94 }; -
branches/atmospheric_engine/src/lib/graphics/effects/lightening_effect.cc
r8713 r8716 145 145 if (this->thunderBuffer != NULL) 146 146 ResourceManager::getInstance()->unload(this->thunderBuffer); 147 this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder. ogg", OGG);147 this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder.wav", WAV); 148 148 149 149 } -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
r8702 r8716 57 57 if (this->rainBuffer != NULL) 58 58 ResourceManager::getInstance()->unload(this->rainBuffer); 59 this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/rain. ogg", OGG);59 this->rainBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/rain.wav", WAV); 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. ogg", OGG);65 this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV); 66 66 } 67 67 -
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc
r8702 r8716 50 50 if (this->windBuffer != NULL) 51 51 ResourceManager::getInstance()->unload(this->windBuffer); 52 this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind. ogg", OGG);52 this->windBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/wind.wav", WAV); 53 53 } 54 54 -
branches/atmospheric_engine/src/world_entities/effects/lightning_bolt.cc
r8702 r8716 64 64 if (this->thunderBuffer != NULL) 65 65 ResourceManager::getInstance()->unload(this->thunderBuffer); 66 this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder. ogg", OGG);66 this->thunderBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/atmosphere/thunder.wav", WAV); 67 67 } 68 68
Note: See TracChangeset
for help on using the changeset viewer.