Changeset 7696 in orxonox.OLD for branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc
- Timestamp:
- May 18, 2006, 4:25:18 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc
r7683 r7696 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" … … 44 45 if (root != NULL) 45 46 this->loadParams(root); 47 48 //load wind sound 49 if (this->snowWindForce > 1) { 50 if (this->windBuffer != NULL) 51 ResourceManager::getInstance()->unload(this->windBuffer); 52 this->windBuffer = (SoundBuffer*)ResourceManager::getInstance()->load("sound/wind.wav", WAV); 53 } 46 54 47 55 this->activate(); … … 77 85 78 86 // Default values 79 particles = 12000; 80 texture = "maps/snow_flake_01_32x32.png"; 81 life = 8; 82 randomLife = 2; 83 snowRadius = 3.5; 84 randomRadius = 1; 85 snowMass = 1.0; 86 randomMass = 0.3; 87 rate = 900; 88 velocity = -100; 89 randomVelocity = 5; 90 angle = 0.5; 91 randomAngle = 0.2; 92 alpha = 0.5; 93 snowSize = Vector2D(2500, 2500); 94 snowCoord = Vector(100,450,400); 95 96 activated = false; 87 this->particles = 12000; 88 this->texture = "maps/snow_flake_01_32x32.png"; 89 this->life = 8; 90 this->randomLife = 2; 91 this->snowRadius = 3.5; 92 this->randomRadius = 1; 93 this->snowMass = 1.0; 94 this->randomMass = 0.3; 95 this->rate = 900; 96 this->velocity = -100; 97 this->randomVelocity = 5; 98 this->angle = 0.5; 99 this->randomAngle = 0.2; 100 this->alpha = 0.5; 101 this->snowSize = Vector2D(2500, 2500); 102 this->snowCoord = Vector(100,450,400); 103 this->snowWindForce = 1; 104 105 this->activated = false; 97 106 } 98 107 … … 119 128 this->emitter->setEmissionRate(rate); 120 129 this->emitter->setEmissionVelocity(velocity, randomVelocity); 121 this->emitter->setSpread(angle , randomAngle);130 this->emitter->setSpread(angle * this->snowWindForce , randomAngle * this->snowWindForce); 122 131 this->emitter->setSize(snowSize); 123 132 124 133 //SnowEffect::snowParticles->precache(8); 134 135 if (this->snowWindForce > 1) 136 this->soundSource.loop(this->windBuffer); 125 137 } 126 138 … … 132 144 133 145 this->emitter->setSystem(NULL); 146 147 if (this->windBuffer != NULL) 148 ResourceManager::getInstance()->unload(this->windBuffer); 149 134 150 } 135 151
Note: See TracChangeset
for help on using the changeset viewer.