Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10658 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
May 21, 2007, 1:48:08 AM (17 years ago)
Author:
bknecht
Message:

changes from landauf

Location:
trunk/src/world_entities/particles
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/particles/box_emitter.cc

    r10114 r10658  
    112112    Quaternion moment = Quaternion(this->momentum + this->momentumRandom, randDir);
    113113
    114     this->getSystem()->addParticle(box, velocityV, orient, moment);
     114    this->getSystem()->addParticle(box, velocityV, orient, moment, extForce);
    115115
    116116  }
  • trunk/src/world_entities/particles/dot_emitter.cc

    r10114 r10658  
    8888
    8989    this->getSystem()->addParticle(this->getAbsCoor() + this->getVelocity()*.1*rand()/RAND_MAX,
    90                                    velocityV, orient, moment);
     90                                   velocityV, orient, moment, extForce);
    9191
    9292  }
  • trunk/src/world_entities/particles/particle_emitter.cc

    r9869 r10658  
    3939  this->setEmissionRate(emissionRate);
    4040  this->setEmissionVelocity(velocity);
     41  this->setExtForce(0, 0, 0);
    4142
    4243  this->saveTime = 0.0;
     
    6970  LoadParam(root, "emission-velocity", this, ParticleEmitter, setEmissionVelocity)
    7071    .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.");
    7175
    7276  LoadParam(root, "emission-momentum", this, ParticleEmitter, setEmissionMomentum)
     
    166170  this->momentum = momentum;
    167171  this->momentumRandom = randomMomentum;
     172}
     173
     174/**
     175 *  sets the external force that affects all particles emitted
     176*/
     177void ParticleEmitter::setExtForce(float x, float y, float z)
     178{
     179    this->extForce = Vector(x, y, z);
    168180}
    169181
  • trunk/src/world_entities/particles/particle_emitter.h

    r10368 r10658  
    4747  void setEmissionVelocity(float velocity, float randomVelocity = 0.0);
    4848  void setEmissionMomentum(float momentum, float randomMomentum = 0.0);
     49  void setExtForce(float x, float y, float z);
    4950
    5051  /** @returns the emissionRate */
     
    7374  float           momentum;          //!< The Initial spped of the Rotation.
    7475  float           momentumRandom;    //!< The random variation of the Momentum.
     76  Vector          extForce;          //!< The external Force
    7577
    7678//private:
  • trunk/src/world_entities/particles/particle_system.cc

    r10528 r10658  
    339339                     + randMassAnim.getValue(tickPart->lifeCycle) * tickPart->massRand;
    340340
    341     tickPart->extForce = Vector(0,0,0);
     341    //tickPart->extForce = Vector(0,0,0);
    342342
    343343    // applying Color
     
    422422 * @param data some more data given by the emitter
    423423*/
    424 void ParticleSystem::addParticle(const Vector& position, const Vector& velocity, const Quaternion& orientation, const Quaternion& momentum, unsigned int data)
     424void ParticleSystem::addParticle(const Vector& position, const Vector& velocity, const Quaternion& orientation, const Quaternion& momentum, const Vector& extForce, unsigned int data)
    425425{
    426426  if (this->count <= this->maxCount)
     
    462462    particles->position = position;
    463463    particles->velocity = velocity;
     464    particles->extForce = extForce;
    464465
    465466    particles->orientation = orientation;
  • trunk/src/world_entities/particles/particle_system.h

    r10528 r10658  
    102102  virtual void tickPhys(float dt) {};
    103103
    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);
    105105
    106106  void precache(unsigned int seconds, unsigned int ticksPerSecond = 25);
  • trunk/src/world_entities/particles/plane_emitter.cc

    r10114 r10658  
    111111    Quaternion moment = Quaternion(this->momentum + this->momentumRandom, randDir);
    112112
    113     this->getSystem()->addParticle(plane, velocityV, orient, moment);
     113    this->getSystem()->addParticle(plane, velocityV, orient, moment, extForce);
    114114
    115115  }
Note: See TracChangeset for help on using the changeset viewer.