Changeset 8521 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics
- Timestamp:
- Jun 16, 2006, 10:34:43 AM (18 years ago)
- Location:
- branches/atmospheric_engine/src/lib/graphics/effects
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc
r8495 r8521 87 87 88 88 void FogEffect::activate() { 89 PRINTF(0)( " Enabling FogEffect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity, this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);89 PRINTF(0)( "Activating FogEffect\n"); 90 90 91 this->fogActivate = true; 92 91 // init fogGL 93 92 GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0}; 94 93 glFogi(GL_FOG_MODE, this->fogMode); … … 98 97 glFogf(GL_FOG_START, this->fogStart); 99 98 glFogf(GL_FOG_END, this->fogEnd); 99 100 this->fogActivate = true; 100 101 101 102 glEnable(GL_FOG); … … 127 128 128 129 void FogEffect::tick(float dt) { 130 129 131 if (!this->fogActivate) 130 132 return; … … 193 195 } 194 196 195 196 GLint FogEffect::stringToFogMode(const std::string& mode) {197 if(mode == "GL_LINEAR")198 return GL_LINEAR;199 else if(mode == "GL_EXP")200 return GL_EXP;201 else if(mode == "GL_EXP2" )202 return GL_EXP2;203 else204 return -1;205 }206 207 -
branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h
r8495 r8521 63 63 64 64 private: 65 GLint stringToFogMode(const std::string& mode); 65 inline GLint stringToFogMode(const std::string& mode) { 66 if(mode == "GL_LINEAR") 67 return GL_LINEAR; 68 else if(mode == "GL_EXP") 69 return GL_EXP; 70 else if(mode == "GL_EXP2" ) 71 return GL_EXP2; 72 else 73 return -1; 74 } 66 75 67 76 bool fogActivate; -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
r8495 r8521 39 39 40 40 /* TODO: 41 - test multiple rain emitters 41 - test multiple rain emitters <-- doesn't work 42 42 - Think about what happens with building poss. to hang movewithcam off 43 43 - Possible to activate lightening … … 207 207 // increase sound volume 208 208 // this->soundSource.fadein(this->rainBuffer, 10); 209 209 210 } else if ( this->rainFadeOutDuration != 0 ) { 210 211 if ( this->localTimer < this->rainFadeOutDuration ) { … … 227 228 // decrease sound volume 228 229 // this->soundSource.fadeout(this->rainBuffer, 10); 230 229 231 } else 230 232 this->deactivate(); … … 258 260 259 261 } 262 263 void RainEffect::hideRain() { 264 265 RainEffect::rainParticles->setColor(0, 0,0,0, 0); 266 RainEffect::rainParticles->setColor(0, 0,0,0, 0); 267 268 } -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
r8495 r8521 37 37 this->activate(); 38 38 } 39 39 40 inline void deactivateRain() { 40 41 this->deactivate(); … … 45 46 void startRaining(); 46 47 void stopRaining(); 48 49 void hideRain(); 47 50 48 51 inline void setRainCoord(float x, float y, float z) { … … 84 87 ParticleEmitter* emitter; 85 88 86 GLfloat rainFadeInDuration;87 GLfloat rainFadeOutDuration;88 float localTimer;89 GLfloat rainFadeInDuration; 90 GLfloat rainFadeOutDuration; 91 float localTimer; 89 92 90 Vector rainCoord;91 Vector2D rainSize;92 GLfloat rainRate;93 GLfloat rainVelocity;94 GLfloat rainLife;95 GLfloat rainMaxParticles;96 int rainWindForce;97 bool rainMove;98 bool rainActivate;93 Vector rainCoord; 94 Vector2D rainSize; 95 GLfloat rainRate; 96 GLfloat rainVelocity; 97 GLfloat rainLife; 98 GLfloat rainMaxParticles; 99 int rainWindForce; 100 bool rainMove; 101 bool rainActivate; 99 102 100 OrxSound::SoundSource soundSource;103 OrxSound::SoundSource soundSource; 101 104 OrxSound::SoundBuffer* rainBuffer; 102 105 OrxSound::SoundBuffer* windBuffer; 103 106 104 float soundRainVolume;107 float soundRainVolume; 105 108 106 LightManager* lightMan;107 GLfloat rainAmbient;109 LightManager* lightMan; 110 GLfloat rainAmbient; 108 111 109 112 }; -
branches/atmospheric_engine/src/lib/graphics/effects/sun_effect.cc
r7836 r8521 56 56 * initializes the graphics effect 57 57 */ 58 boolSunEffect::init()58 void SunEffect::init() 59 59 {} 60 60 -
branches/atmospheric_engine/src/lib/graphics/effects/sun_effect.h
r7810 r8521 1 1 /*! 2 2 * @file sun_effect.h 3 * 3 * 4 4 */ 5 5 … … 20 20 virtual void loadParams(const TiXmlElement* root); 21 21 22 virtual boolinit();22 virtual void init(); 23 23 24 virtual boolactivate() = 0;25 virtual booldeactivate() = 0;24 virtual void activate() = 0; 25 virtual void deactivate() = 0; 26 26 27 27 virtual void draw() const;
Note: See TracChangeset
for help on using the changeset viewer.