Changeset 4274 in orxonox.OLD for orxonox/branches/physics/src/lib/graphics/particles/particle_emitter.cc
- Timestamp:
- May 22, 2005, 10:21:00 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/lib/graphics/particles/particle_emitter.cc
r4178 r4274 31 31 { 32 32 this->setClassName ("ParticleEmitter"); 33 34 this->type = EMITTER_DOT; 35 this->emitterSize = 1.0; 33 36 this->direction = direction; 34 37 this->setSpread(angle); … … 50 53 { 51 54 ParticleEngine::getInstance()->removeEmitter(this); 52 53 55 } 54 56 … … 69 71 70 72 /* these are Animation interfaces: so you can change spec values as you want */ 73 74 /** 75 \param type the new Type of this emitter 76 */ 77 void ParticleEmitter::setType(EMITTER_TYPE type) 78 { 79 this->type = type; 80 } 81 82 void ParticleEmitter::setSize(float emitterSize) 83 { 84 this->emitterSize = emitterSize; 85 } 71 86 72 87 /** … … 140 155 // this should spread the Particles evenly. if the Emitter is moved around quickly 141 156 Vector equalSpread = this->getVelocity() * random()/RAND_MAX * dt; 157 Vector extension; // the Vector for different fields. 142 158 143 system->addParticle(this->getAbsCoor() - equalSpread, velocityV); 159 if (this->type & 2) 160 { 161 extension = Vector(this->emitterSize * ((float)rand()/RAND_MAX -.5), 0, this->emitterSize * ((float)rand()/RAND_MAX - .5)); 162 extension = this->getAbsDir().apply(extension); 163 } 164 else if (this->type & 8) 165 { 166 extension = Vector((float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5, (float)rand()/RAND_MAX -.5) * this->emitterSize; 167 } 168 169 system->addParticle(this->getAbsCoor() + extension - equalSpread, velocityV); 170 144 171 } 145 172 }
Note: See TracChangeset
for help on using the changeset viewer.