Changeset 9205 in orxonox.OLD for branches/presentation/src/lib/graphics/effects/fog_effect.cc
- Timestamp:
- Jul 5, 2006, 10:40:50 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/lib/graphics/effects/fog_effect.cc
r9182 r9205 20 20 #include "shell_command.h" 21 21 #include "script_class.h" 22 #include "cloud_effect.h" 22 23 23 24 // Define shell commands … … 84 85 this->fogFadeInActivate = false; 85 86 this->fogFadeOutActivate = false; 87 88 this->cloudColor = Vector(0.2f, 0.3f, 0.3f); 89 this->skyColor = Vector(0.2f, 0.3f, 0.3f); 86 90 } 87 91 … … 93 97 WeatherEffect::loadParams(root); 94 98 95 LoadParam(root, "mode", this, FogEffect, setFogMode).describe("fog mode (linear, exponential)");; 96 LoadParam(root, "density", this, FogEffect, setFogDensity).describe("fog density if exp. fog");; 97 LoadParam(root, "range", this, FogEffect, setFogRange).describe("fog range: start, end");; 98 LoadParam(root, "color", this, FogEffect, setFogColor).describe("fog color: r,g,b");; 99 LoadParam(root, "fadeinduration", this, FogEffect, setFogFadeIn).describe("duration of the fade in");; 100 LoadParam(root, "fadeoutduration", this, FogEffect, setFogFadeOut).describe("duration of the fade out");; 101 99 LoadParam(root, "mode", this, FogEffect, setFogMode).describe("fog mode (linear, exponential)"); 100 LoadParam(root, "density", this, FogEffect, setFogDensity).describe("fog density if exp. fog"); 101 LoadParam(root, "range", this, FogEffect, setFogRange).describe("fog range: start, end"); 102 LoadParam(root, "color", this, FogEffect, setFogColor).describe("fog color: r,g,b"); 103 LoadParam(root, "fadeinduration", this, FogEffect, setFogFadeIn).describe("duration of the fade in"); 104 LoadParam(root, "fadeoutduration", this, FogEffect, setFogFadeOut).describe("duration of the fade out"); 105 LoadParam(root, "cloudcolor", this, FogEffect, setCloudColor); 106 LoadParam(root, "skycolor", this, FogEffect, setSkyColor); 107 102 108 LOAD_PARAM_START_CYCLE(root, element); 103 109 { 104 LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption).describe("sets a fog option: activate"); ;110 LoadParam_CYCLE(element, "option", this, FogEffect, setFogOption).describe("sets a fog option: activate"); 105 111 } 106 112 LOAD_PARAM_END_CYCLE(element); … … 125 131 126 132 glEnable(GL_FOG); 133 134 // Store cloud- and sky color before the snow 135 this->oldCloudColor = CloudEffect::cloudColor; 136 this->oldSkyColor = CloudEffect::skyColor; 137 138 // Change the colors 139 CloudEffect::changeCloudColor(this->cloudColor, this->fogFadeInDuration); 140 CloudEffect::changeSkyColor(this->skyColor, this->fogFadeInDuration); 127 141 } 128 142 … … 207 221 // If no manual FadeIn value was set, set a default value 208 222 if (!this->fogFadeInDuration > 0) 209 this->fogFadeInDuration = 20;223 this->fogFadeInDuration = 10; 210 224 211 225 // Reset local timer … … 227 241 this->fogFadeInActivate = false; 228 242 243 229 244 // If Fog is off, turn it on first 230 245 if (!this->fogActivate) … … 233 248 // If no manual FadeOut value was set, set a default value 234 249 if (!this->fogFadeOutDuration > 0) 235 this->fogFadeOutDuration = 20;250 this->fogFadeOutDuration = 10; 236 251 237 252 // set FogFadeOut activate … … 240 255 // Reset local timer 241 256 this->localTimer = 0; 242 } 243 257 258 // Restore the old cloud- and sky color 259 CloudEffect::changeCloudColor(this->oldCloudColor, this->fogFadeOutDuration); 260 CloudEffect::changeSkyColor(this->oldSkyColor, this->fogFadeOutDuration); 261 } 262
Note: See TracChangeset
for help on using the changeset viewer.