Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 3, 2005, 2:10:47 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: inheritSpeed now property of particle_emitter. system not friend emitter anymore

File:
1 edited

Legend:

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

    r4478 r4493  
    77#define _PARTICLE_SYSTEM_H
    88
    9 #include "base_object.h"
     9#include "world_entity.h"
    1010#include "physics_interface.h"
    1111
     
    4141typedef struct Particle
    4242{
    43   float lifeTime;             //!< The time this particle has to live.
    44   float lifeCycle;            //!< The fraction of time passed. (in percentage of its lifeTime)
     43  float         lifeTime;            //!< The time this particle has to live.
     44  float         lifeCycle;           //!< The fraction of time passed. (in percentage of its lifeTime)
    4545
    46   Vector position;            //!< The current position of this particle.
    47   Vector velocity;            //!< The current velocity of this particle.
    48   Vector extForce;            //!< The external Force that influences this Particle.
    49   Quaternion rotation;        //!< The current rotation of this particle.
    50   float mass;                 //!< The mass of this particle.
    51   float massRand;             //!< A random mass
    52   float radius;               //!< The current size of this particle.
    53   float radiusRand;           //!< a random Radius
     46  Vector        position;            //!< The current position of this particle.
     47  Vector        velocity;            //!< The current velocity of this particle.
     48  Vector        extForce;            //!< The external Force that influences this Particle.
     49  Quaternion    rotation;            //!< The current rotation of this particle.
     50  float         mass;                //!< The mass of this particle.
     51  float         massRand;            //!< A random mass
     52  float         radius;              //!< The current size of this particle.
     53  float         radiusRand;          //!< a random Radius
     54  GLfloat       color [4];           //!< A Color for the particles.
    5455
    55   GLfloat color [4];          //!< A Color for the particles.
    56 
    57   Particle* next;             //!< pointer to the next particle in the List. (NULL if no preceding one)
     56  Particle*     next;                //!< pointer to the next particle in the List. (NULL if no preceding one)
    5857};
    5958
    6059//! A class to handle ParticleSystems
    61 class ParticleSystem : public PhysicsInterface {
    62   friend class ParticleEmitter;
     60class ParticleSystem : public WorldEntity, public PhysicsInterface {
    6361 
    6462 public:
     
    6967  void setType(PARTICLE_TYPE particleType, int count = 0);
    7068  void setMaterial(Material* material);
    71   void setInheritSpeed(float value);
    7269  void setLifeSpan(float lifeSpan, float randomLifeSpan = 0.0);
    7370  void setConserve(float conserve);
     
    8279  /** \returns the Material that lies on this particles */
    8380  inline const Material* getMaterial(void) const { return this->material; };
    84   /** \returns the inherit-speed-factor */
    85   inline float getInheritSpeed(void) const { return this->inheritSpeed; };
    8681  /** \returns the lifespan of the particles */
    8782  inline float getLifeSpan(void) const { return this->lifeSpan; };
     
    10196  void addParticle(const Vector& position, const Vector& velocity, unsigned int data = 0);
    10297
    103   void tick(float dt);
    104   void draw(void) const;
     98  virtual void tick(float dt);
     99  virtual void draw(void) const;
    105100
    106101  void debug(void);
    107102
    108103 private:
    109   char*             name;                //!< the Name of the Particle System
    110 
    111104  float             conserve;            //!< How much energy gets conserved to the next Tick.
    112105  float             lifeSpan;            //!< Initial lifetime of a Particle.
     
    114107  float             initialMass;         //!< The initial Mass of the Particle
    115108  float             randomInitialMass;   //!< The random initial Mass of the Particle
    116   float             inheritSpeed;        //!< How much speed the particle inherits from the Emitters speed \todo move this to the emitter
    117109
    118   // particles
    119110  int               maxCount;            //!< The maximum count of Particles.
    120111  int               count;               //!< The current count of Particles.
     
    128119
    129120  // per particle attributes
    130   QuickAnimation radiusAnim;             //!< Animation of the radius
    131   QuickAnimation randRadiusAnim;         //!< Animation of the random Value of the radius
    132   QuickAnimation massAnim;               //!< Animation of the mass
    133   QuickAnimation randMassAnim;           //!< Animation of the random Mass
    134   QuickAnimation colorAnim[4];           //!< Animation of the 4 colors (r,g,b,a)
     121  QuickAnimation    radiusAnim;          //!< Animation of the radius
     122  QuickAnimation    randRadiusAnim;      //!< Animation of the random Value of the radius
     123  QuickAnimation    massAnim;            //!< Animation of the mass
     124  QuickAnimation    randMassAnim;        //!< Animation of the random Mass
     125  QuickAnimation    colorAnim[4];        //!< Animation of the 4 colors (r,g,b,a)
    135126};
    136127
Note: See TracChangeset for help on using the changeset viewer.