Changeset 8356 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
- Timestamp:
- Jun 14, 2006, 2:15:03 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
r8327 r8356 31 31 SHELL_COMMAND(activate, RainEffect, activateRain); 32 32 SHELL_COMMAND(deactivate, RainEffect, deactivateRain); 33 34 SHELL_COMMAND(st artRaining, RainEffect, startRaining);33 SHELL_COMMAND(startraining, RainEffect, startRaining); 34 SHELL_COMMAND(stopraining, RainEffect, stopRaining); 35 35 36 36 using namespace std; … … 210 210 // this->soundSource.fadein(this->rainBuffer, 10); 211 211 } 212 else if (this->rainFadeOutDuration != 0 && this->localTimer < this->rainFadeOutDuration) { 213 this->localTimer += dt; 214 float progress = 1 - (this->localTimer / this->rainFadeOutDuration); 215 216 // Dim Light 217 lightMan->setAmbientColor(1.1 - progress, 1.1 - progress, 1.1 - progress); 218 219 // use alpha in color to fade in 220 RainEffect::rainParticles->setColor(0, 0.3, 0.3, 0.5, 0.2 * progress); // grey blue 1 221 RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2 * progress); // grey blue 2 222 RainEffect::rainParticles->setColor(1, 0.7, 0.7, 0.7, 0.2 * progress); // light grey 223 224 // increase radius for more "heavy" rain 225 RainEffect::rainParticles->setRadius(0, 0.03 * progress); 226 RainEffect::rainParticles->setRadius(0.2, 0.02 * progress); 227 RainEffect::rainParticles->setRadius(1, 0.01 * progress); 228 229 // increase sound volume 230 // this->soundSource.fadein(this->rainBuffer, 10); 231 } 212 232 213 233 } … … 225 245 226 246 } 247 248 void RainEffect::stopRaining() { 249 250 if (this->rainActivate) 251 this->deactivate(); 252 253 if (!this->rainFadeOutDuration > 0) 254 this->rainFadeOutDuration = 20; 255 256 this->localTimer = 0; 257 this->activate(); 258 259 }
Note: See TracChangeset
for help on using the changeset viewer.