Changeset 8356 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/fog_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/fog_effect.cc
r8327 r8356 24 24 SHELL_COMMAND(activate, FogEffect, activateFog); 25 25 SHELL_COMMAND(deactivate, FogEffect, deactivateFog); 26 SHELL_COMMAND(startfogging, FogEffect, startFogging); 26 SHELL_COMMAND(fadein, FogEffect, fadeInFog); 27 SHELL_COMMAND(fadeout, FogEffect, fadeOutFog); 28 27 29 28 30 using namespace std; … … 137 139 this->fogFadeDensity = progress * this->fogDensity; 138 140 } 141 else if (this->fogFadeOutDuration > 0 && this->localTimer < this->fogFadeOutDuration) { 142 this->localTimer += dt; 143 float progress = this->localTimer / this->fogFadeInDuration; 144 this->fogFadeDensity = 1 - progress * this->fogDensity; 145 } 139 146 } 140 147 141 void FogEffect:: startFogging() {148 void FogEffect::fadeInFog() { 142 149 143 150 if (this->fogActivate) … … 150 157 this->activate(); 151 158 159 } 160 161 162 void FogEffect::fadeOutFog() { 163 164 if (this->fogActivate) 165 this->deactivate(); 166 167 if (!this->fogFadeOutDuration > 0) 168 this->fogFadeOutDuration = 20; 169 170 this->localTimer = 0; 171 this->activate(); 152 172 } 153 173
Note: See TracChangeset
for help on using the changeset viewer.