Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6621 in orxonox.OLD for trunk/src/lib/particles/particle_system.h


Ignore:
Timestamp:
Jan 19, 2006, 11:46:28 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: particle derivate… still working on this

File:
1 edited

Legend:

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

    r6612 r6621  
    2626#define PARTICLE_MULTI_MASK            0x100000     //!< A Mask if they are Multi-partilces
    2727
    28 //! An enumerator for the different types of particles.
    29 typedef enum PARTICLE_TYPE
    30 {
    31   PARTICLE_DOT           =  PARTICLE_DOT_MASK,
    32   PARTICLE_SPARK         =  PARTICLE_SPARK_MASK,
    33   PARTICLE_SPRITE        =  PARTICLE_SPRITE_MASK,
    34   PARTICLE_MULTI_SPRITE  =  PARTICLE_SPRITE_MASK | PARTICLE_MULTI_MASK,
    35   PARTICLE_MODEL         =  PARTICLE_MODEL_MASK,
    36   PARTICLE_MULTI_MODE    =  PARTICLE_MODEL_MASK | PARTICLE_MULTI_MASK
    37 };
    38 
    3928#define PARTICLE_DEFAULT_MAX_COUNT    200               //!< A default count of particles in the system.
    40 #define PARTICLE_DEFAULT_TYPE         PARTICLE_SPRITE   //!< A default type of the system.
    4129
    4230// FORWARD DECLARATION
     
    6957
    7058 public:
    71   ParticleSystem(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT,
    72                  PARTICLE_TYPE type = PARTICLE_DEFAULT_TYPE);
     59  ParticleSystem(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT);
    7360  ParticleSystem(const TiXmlElement* root);
    7461  virtual ~ParticleSystem();
     
    7764  virtual void loadParams(const TiXmlElement* root);
    7865
    79   void setType(const char* particleType);
    80   void setType(PARTICLE_TYPE particleType, int count = 0);
    8166  void setMaterial(Material* material);
    8267  void setMaterialTexture(const char* textureFile);
     
    9176  void setColor(float lifeCycleTime, float red, float green, float blue, float alpha);
    9277
    93   /** @returns the Type of the particles */
    94   inline PARTICLE_TYPE getType() const { return this->particleType; };
    9578  /** @returns the Material that lies on this particles */
    9679  inline const Material* getMaterial() const { return this->material; };
     
    11396
    11497  virtual void applyField(Field* field);
    115   /** \brief this is an empty function, because the Physics are implemented in tick @param dt: useless here */
     98  /** @brief this is an empty function, because the Physics are implemented in tick @param dt: useless here */
    11699  virtual void tickPhys(float dt) {};
    117100
     
    119102
    120103  virtual void tick(float dt);
    121   virtual void draw() const;
     104  virtual void draw() const = 0;
    122105
    123106  void debug() const;
    124107
    125  private:
     108 protected:
    126109  float             conserve;            //!< How much energy gets conserved to the next Tick.
    127110  float             lifeSpan;            //!< Initial lifetime of a Particle.
     
    132115  int               maxCount;            //!< The maximum count of Particles.
    133116  int               count;               //!< The current count of Particles.
    134   PARTICLE_TYPE     particleType;        //!< A type for all the Particles
    135117  Material*         material;            //!< A Material for all the Particles.
    136118  Particle*         particles;           //!< A list of particles of this System.
Note: See TracChangeset for help on using the changeset viewer.