Changeset 7682 in orxonox.OLD for branches/atmospheric_engine/src/lib
- Timestamp:
- May 18, 2006, 2:38:19 PM (18 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
r7652 r7682 60 60 WeatherEffect::loadParams(root); 61 61 62 LoadParam(root, "moverain", this, RainEffect, setMoveRain);62 // LoadParam(root, "moverain", this, RainEffect, setMoveRain); 63 63 LoadParam(root, "coord", this, RainEffect, setRainCoord); 64 64 LoadParam(root, "size", this, RainEffect, setRainSize); … … 66 66 LoadParam(root, "velocity", this, RainEffect, setRainVelocity); 67 67 LoadParam(root, "life", this, RainEffect, setRainLife); 68 LoadParam(root, "wind", this, RainEffect, setRainWind); 69 70 // LOAD_PARAM_START_CYCLE(root, element); 71 // { 72 // element->ToText(); 73 // LoadParam_CYCLE(element, "option", this, RainEffect, setRainOption); 74 // } 75 // LOAD_PARAM_END_CYCLE(element); 76 68 77 } 69 78 … … 74 83 this->rainCoord = Vector(500, 500, 500); 75 84 this->rainSize = Vector2D(1000, 1000); 76 this->rainRate = 5000;85 this->rainRate = 3000; 77 86 this->rainVelocity = -300; 78 this->rainLife = 2; 87 this->rainLife = 4; 88 this->rainMaxParticles = this->rainRate * this->rainLife; 79 89 80 90 this->emitter = new PlaneEmitter(this->rainSize); … … 90 100 if (unlikely(RainEffect::rainParticles == NULL)) 91 101 { 92 RainEffect::rainParticles = new SparkParticles( 50000);102 RainEffect::rainParticles = new SparkParticles((int) this->rainMaxParticles); 93 103 RainEffect::rainParticles->setName("RainParticles"); 104 RainEffect::rainParticles->precache((int)this->rainLife); 94 105 RainEffect::rainParticles->setLifeSpan(this->rainLife, 2); 95 RainEffect::rainParticles->setRadius(0.02, 0.02); 96 RainEffect::rainParticles->setRadius(0.01, 0.01); 97 RainEffect::rainParticles->setRadius(0.03, 0.03); 98 RainEffect::rainParticles->setRadius(0.04, 0.04); 99 RainEffect::rainParticles->setColor(0.7, 0.3, 0.3, 0.5, 0.2); // grey blue 1 100 RainEffect::rainParticles->setColor(1, 0.4, 0.4, 0.5, 0.1); // grey blue 2 101 RainEffect::rainParticles->setColor(0.5, 0.7, 0.7, 0.7, 0); // light grey 106 RainEffect::rainParticles->setRadius(0, 0.03); 107 RainEffect::rainParticles->setRadius(0.2, 0.02); 108 RainEffect::rainParticles->setRadius(1, 0.01); 109 RainEffect::rainParticles->setColor(0, 0.3, 0.3, 0.5, 0.2); // grey blue 1 110 RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2); // grey blue 2 111 RainEffect::rainParticles->setColor(1, 0.7, 0.7, 0.7, 0.2); // light grey 102 112 } 103 113 … … 109 119 this->emitter->setEmissionVelocity(this->rainVelocity); 110 120 111 this->emitter->setSpread( 0, .2);121 this->emitter->setSpread(this->rainWindForce / 5, .2); 112 122 113 123 this->soundSource.loop(this->rainBuffer); -
branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.h
r7652 r7682 40 40 inline void setRainVelocity(float velocity) { this->rainVelocity = -velocity; } 41 41 inline void setRainLife(float life) { this->rainLife = life; } 42 inline void setMoveRain() { PRINTF(0)( "setting move true\n"); this->rainMove = true; } 42 inline void setRainWind(int force) { this->rainWindForce = force; } 43 44 inline void setRainOption(string option) { 45 PRINTF(0)( "setting move true\n"); 46 this->rainMove = true; 47 } 43 48 44 49 … … 52 57 GLfloat rainVelocity; 53 58 GLfloat rainLife; 59 GLfloat rainMaxParticles; 60 int rainWindForce; 54 61 bool rainMove; 55 62
Note: See TracChangeset
for help on using the changeset viewer.