Changeset 7646 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects
- Timestamp:
- May 17, 2006, 12:41:35 PM (19 years ago)
- Location:
- branches/atmospheric_engine/src/lib/graphics/effects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc
r7628 r7646 17 17 #include "util/loading/load_param.h" 18 18 #include "util/loading/factory.h" 19 #include "util/loading/resource_manager.h" 19 20 20 21 #include "glincl.h" 21 #include "debug.h"22 // #include "debug.h" 22 23 23 24 #include "state.h" … … 40 41 if (root != NULL) 41 42 this->loadParams(root); 43 44 // this->soundSource.setSourceNode(this); 45 46 //load sound 47 if (this->rainBuffer != NULL) 48 ResourceManager::getInstance()->unload(this->rainBuffer); 49 this->rainBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/rain.wav", WAV); 42 50 43 51 this->init(); … … 65 73 { 66 74 this->emitter = new PlaneEmitter(this->rainSize); 75 67 76 } 68 77 … … 79 88 RainEffect::rainParticles->setName("RainParticles"); 80 89 RainEffect::rainParticles->setLifeSpan(2, 2); 81 RainEffect::rainParticles->setRadius(0.05, 0.05); 90 RainEffect::rainParticles->setRadius(0.02, 0.02); 91 RainEffect::rainParticles->setRadius(0.01, 0.01); 92 RainEffect::rainParticles->setRadius(0.03, 0.03); 82 93 RainEffect::rainParticles->setRadius(0.04, 0.04); 83 RainEffect::rainParticles->setRadius(0.03, 0.03); 84 RainEffect::rainParticles->setColor(0, 0, 0, 1, .3); 85 RainEffect::rainParticles->setColor(0.5, 0.5, 0.5, 1, 0.2); 86 RainEffect::rainParticles->setColor(0.8, 0.8, 0.2, 0.3, 0.3); 87 RainEffect::rainParticles->setColor(1, 0.5, 0.5, 1, 0); 94 RainEffect::rainParticles->setColor(0.7, 0.3, 0.3, 0.5, 0.2); // grey blue 1 95 RainEffect::rainParticles->setColor(1, 0.4, 0.4, 0.5, 0.1); // grey blue 2 96 RainEffect::rainParticles->setColor(0.5, 0.7, 0.7, 0.7, 0); // light grey 88 97 } 89 98 90 99 this->emitter->setSystem(RainEffect::rainParticles); 91 100 92 RainEffect::rainParticles->debug();101 // RainEffect::rainParticles->debug(); 93 102 94 103 this->emitter->setRelCoor(this->rainCoord); 95 104 96 105 this->emitter->setEmissionRate(this->rainRate); 97 this->emitter->setEmissionVelocity( -this->rainVelocity);106 this->emitter->setEmissionVelocity(this->rainVelocity); 98 107 99 this->emitter->setSpread(0, .3); 108 this->emitter->setSpread(0, .2); 109 110 this->soundSource.loop(this->rainBuffer); 111 PRINTF(0)( "Playing RainSound\n" ); 100 112 } 101 113 … … 107 119 this->emitter->setSystem(NULL); 108 120 } 121 122 void RainEffect::tick (float dt) 123 { 124 125 } -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
r7628 r7646 16 16 #include "weather_effect.h" 17 17 18 #include "sound_buffer.h" 19 #include "sound_source.h" 20 18 21 19 22 class RainEffect : public WeatherEffect … … 30 33 virtual bool deactivate(); 31 34 35 virtual void tick(float dt); 36 32 37 inline void setRainCoord(float x, float y, float z) { this->rainCoord = Vector(x, y, z); } 33 38 inline void setRainSize(float x, float y) { this->rainSize = Vector2D(x, y); } 34 39 inline void setRainRate(float rate) { this->rainRate = rate;} 35 inline void setRainVelocity(float velocity) { this->rainVelocity = velocity; }40 inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; } 36 41 37 42 private: … … 43 48 GLfloat rainRate; 44 49 GLfloat rainVelocity; 50 51 SoundSource soundSource; 52 SoundBuffer* rainBuffer; 45 53 }; 46 54
Note: See TracChangeset
for help on using the changeset viewer.