Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6825 in orxonox.OLD for trunk/src/lib/particles/particle_emitter.h


Ignore:
Timestamp:
Jan 29, 2006, 1:07:01 PM (18 years ago)
Author:
bensch
Message:

trunk: new interface to ParticleEmitters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/particles/particle_emitter.h

    r6822 r6825  
    1818#define PARTICLE_EMITTER_DEFAULT_INHERIT_SPEED     0.0
    1919#define PARTICLE_EMITTER_DEFAULT_SPREAD            M_PI
     20#define PARTICLE_EMITTER_DEFAULT_VELOCITY          1.0
    2021
    2122//! A class to handle an Emitter.
     
    2425  friend class ParticleSystem;
    2526public:
    26   ParticleEmitter(const Vector& direction = Vector(1.0,0.0,0.0) , float angle = .5,
    27                   float emissionRate = 1.0, float velocity = 1.0);
     27  ParticleEmitter(float emissionRate = PARTICLE_EMITTER_DEFAULT_EMISSION_RATE,
     28                  float velocity = PARTICLE_EMITTER_DEFAULT_VELOCITY,
     29                  float angle = PARTICLE_EMITTER_DEFAULT_SPREAD);
    2830  virtual ~ParticleEmitter();
    2931
     
    4547  void setEmissionMomentum(float momentum, float randomMomentum = 0.0);
    4648
    47   void setDirection(float x, float y, float z) { this->direction = Vector(x,y,z); }; //!< todo this should be done via PNODE
    48 
    4949  /** @returns the emissionRate */
    5050  inline float getEmissionRate() const { return this->emissionRate; };
     
    5858  inline float getEmissionMomentum() const { return this->momentum; };
    5959
    60   virtual void emitParticles(unsigned int count) const = 0;
    6160
    6261  void debug() const;
    6362
    6463protected:
     64  virtual void emitParticles(unsigned int count) const = 0;
    6565
     66protected:
    6667  float           inheritSpeed;      //!< How much speed the particle inherits from the Emitters speed.
    67   Vector          direction;         //!< emition direction.
    6868  float           angle;             //!< max angle from the direction of the emitter
    6969  float           randomAngle;       //!< random emission angle (angle +- angleRandom is the emitted angle.
Note: See TracChangeset for help on using the changeset viewer.