Changeset 10658 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- May 21, 2007, 1:48:08 AM (17 years ago)
- Location:
- trunk/src/world_entities/particles
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/particles/box_emitter.cc
r10114 r10658 112 112 Quaternion moment = Quaternion(this->momentum + this->momentumRandom, randDir); 113 113 114 this->getSystem()->addParticle(box, velocityV, orient, moment );114 this->getSystem()->addParticle(box, velocityV, orient, moment, extForce); 115 115 116 116 } -
trunk/src/world_entities/particles/dot_emitter.cc
r10114 r10658 88 88 89 89 this->getSystem()->addParticle(this->getAbsCoor() + this->getVelocity()*.1*rand()/RAND_MAX, 90 velocityV, orient, moment );90 velocityV, orient, moment, extForce); 91 91 92 92 } -
trunk/src/world_entities/particles/particle_emitter.cc
r9869 r10658 39 39 this->setEmissionRate(emissionRate); 40 40 this->setEmissionVelocity(velocity); 41 this->setExtForce(0, 0, 0); 41 42 42 43 this->saveTime = 0.0; … … 69 70 LoadParam(root, "emission-velocity", this, ParticleEmitter, setEmissionVelocity) 70 71 .describe("How fast the particles are emittet (their initial speed)"); 72 73 LoadParam(root, "ext-force", this, ParticleEmitter, setExtForce) 74 .describe("The external force that affects the particles."); 71 75 72 76 LoadParam(root, "emission-momentum", this, ParticleEmitter, setEmissionMomentum) … … 166 170 this->momentum = momentum; 167 171 this->momentumRandom = randomMomentum; 172 } 173 174 /** 175 * sets the external force that affects all particles emitted 176 */ 177 void ParticleEmitter::setExtForce(float x, float y, float z) 178 { 179 this->extForce = Vector(x, y, z); 168 180 } 169 181 -
trunk/src/world_entities/particles/particle_emitter.h
r10368 r10658 47 47 void setEmissionVelocity(float velocity, float randomVelocity = 0.0); 48 48 void setEmissionMomentum(float momentum, float randomMomentum = 0.0); 49 void setExtForce(float x, float y, float z); 49 50 50 51 /** @returns the emissionRate */ … … 73 74 float momentum; //!< The Initial spped of the Rotation. 74 75 float momentumRandom; //!< The random variation of the Momentum. 76 Vector extForce; //!< The external Force 75 77 76 78 //private: -
trunk/src/world_entities/particles/particle_system.cc
r10528 r10658 339 339 + randMassAnim.getValue(tickPart->lifeCycle) * tickPart->massRand; 340 340 341 tickPart->extForce = Vector(0,0,0);341 //tickPart->extForce = Vector(0,0,0); 342 342 343 343 // applying Color … … 422 422 * @param data some more data given by the emitter 423 423 */ 424 void ParticleSystem::addParticle(const Vector& position, const Vector& velocity, const Quaternion& orientation, const Quaternion& momentum, unsigned int data)424 void ParticleSystem::addParticle(const Vector& position, const Vector& velocity, const Quaternion& orientation, const Quaternion& momentum, const Vector& extForce, unsigned int data) 425 425 { 426 426 if (this->count <= this->maxCount) … … 462 462 particles->position = position; 463 463 particles->velocity = velocity; 464 particles->extForce = extForce; 464 465 465 466 particles->orientation = orientation; -
trunk/src/world_entities/particles/particle_system.h
r10528 r10658 102 102 virtual void tickPhys(float dt) {}; 103 103 104 void addParticle(const Vector& position, const Vector& velocity, const Quaternion& orientation, const Quaternion& momentum, unsigned int data = 0);104 void addParticle(const Vector& position, const Vector& velocity, const Quaternion& orientation, const Quaternion& momentum, const Vector& extForce, unsigned int data = 0); 105 105 106 106 void precache(unsigned int seconds, unsigned int ticksPerSecond = 25); -
trunk/src/world_entities/particles/plane_emitter.cc
r10114 r10658 111 111 Quaternion moment = Quaternion(this->momentum + this->momentumRandom, randDir); 112 112 113 this->getSystem()->addParticle(plane, velocityV, orient, moment );113 this->getSystem()->addParticle(plane, velocityV, orient, moment, extForce); 114 114 115 115 }
Note: See TracChangeset
for help on using the changeset viewer.