Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 2, 2005, 5:01:50 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: particles documented

File:
1 edited

Legend:

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

    r4436 r4478  
    1515#include "quick_animation.h"
    1616
    17 #define PARTICLE_DOT_MASK           0x000001
    18 #define PARTICLE_SPARK_MASK         0x000010
    19 #define PARTICLE_SPRITE_MASK        0x000100
    20 #define PARTICLE_MODEL_MASK         0x001000
    21 #define PARTICLE_WORDL_ENTITY_MASK  0x010000
    22 #define PARTICLE_MULTI_MASK         0x100000
     17#define PARTICLE_DOT_MASK              0x000001     //!< A Mask if the Particles should be displayed as DOTs
     18#define PARTICLE_SPARK_MASK            0x000010     //!< A Mask if the Particles should be displayed as SPARKs
     19#define PARTICLE_SPRITE_MASK           0x000100     //!< A Mask if the Particles should be displayed as SPRITESs
     20#define PARTICLE_MODEL_MASK            0x001000     //!< A Mask if the Particles should be displayed as MODELSs
     21#define PARTICLE_WORDL_ENTITY_MASK     0x010000     //!< A Mask if the Particles should be displayed as WORLD_ENTITIEs
     22#define PARTICLE_MULTI_MASK            0x100000     //!< A Mask if they are Multi-partilces
    2323
    2424//! An enumerator for the different types of particles.
    25 typedef enum PARTICLE_TYPE {PARTICLE_DOT = PARTICLE_DOT_MASK,
    26                             PARTICLE_SPARK = PARTICLE_SPARK_MASK,
    27                             PARTICLE_SPRITE = PARTICLE_SPRITE_MASK,
    28                             PARTICLE_MULTI_SPRITE = PARTICLE_SPRITE_MASK | PARTICLE_MULTI_MASK,
    29                             PARTICLE_MODEL = PARTICLE_MODEL_MASK,
    30                             PARTICLE_MULTI_MODE = PARTICLE_MODEL_MASK | PARTICLE_MULTI_MASK};
     25typedef enum PARTICLE_TYPE { PARTICLE_DOT           = PARTICLE_DOT_MASK,
     26                             PARTICLE_SPARK         = PARTICLE_SPARK_MASK,
     27                             PARTICLE_SPRITE        = PARTICLE_SPRITE_MASK,
     28                             PARTICLE_MULTI_SPRITE  = PARTICLE_SPRITE_MASK | PARTICLE_MULTI_MASK,
     29                             PARTICLE_MODEL         = PARTICLE_MODEL_MASK,
     30                             PARTICLE_MULTI_MODE    =  PARTICLE_MODEL_MASK | PARTICLE_MULTI_MASK };
    3131
    32 #define PARTICLE_DEFAULT_MAX_COUNT    200               //!< a default count of particles in the system.
     32#define PARTICLE_DEFAULT_MAX_COUNT    200               //!< A default count of particles in the system.
    3333#define PARTICLE_DEFAULT_TYPE         PARTICLE_SPRITE   //!< A default type of the system.
    3434
     
    4949  Quaternion rotation;        //!< The current rotation of this particle.
    5050  float mass;                 //!< The mass of this particle.
    51   float massRand;
     51  float massRand;             //!< A random mass
    5252  float radius;               //!< The current size of this particle.
    53   float radiusRand;
     53  float radiusRand;           //!< a random Radius
    5454
    5555  GLfloat color [4];          //!< A Color for the particles.
    56 
    57   PARTICLE_TYPE type;
    5856
    5957  Particle* next;             //!< pointer to the next particle in the List. (NULL if no preceding one)
     
    9896
    9997  virtual void applyField(Field* field);
     98  /** \brief this is an empty function, because the Physics are implemented in tick \param dt: useless here */
    10099  virtual void tickPhys(float dt) {};
    101100
     
    108107
    109108 private:
    110   char* name;                // the Name of the Particle System
     109  char*             name;                //!< the Name of the Particle System
    111110
    112   float conserve;            //!< How much energy gets conserved to the next Tick.
    113   float lifeSpan;            //!< Initial lifetime of a Particle.
    114   float randomLifeSpan;      //!< A random value for the Lifespan (around the initial lifetime)
    115   float initialMass;         //!< The initial Mass of the Particle
    116   float randomInitialMass;   //!< The random initial Mass of the Particle
    117   float inheritSpeed;        //!< How much speed the particle inherits from the Emitters speed \todo move this to the emitter
     111  float             conserve;            //!< How much energy gets conserved to the next Tick.
     112  float             lifeSpan;            //!< Initial lifetime of a Particle.
     113  float             randomLifeSpan;      //!< A random value for the Lifespan (around the initial lifetime)
     114  float             initialMass;         //!< The initial Mass of the Particle
     115  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
    118117
    119118  // particles
    120   int maxCount;              //!< The maximum count of Particles.
    121   int count;                 //!< The current count of Particles.
    122   PARTICLE_TYPE particleType;//!< A type for all the Particles
    123   Material* material;        //!< A Material for all the Particles.
    124   Particle* particles;       //!< A list of particles of this System.
    125   Particle* deadList;        //!< A list of dead Particles in the System.
     119  int               maxCount;            //!< The maximum count of Particles.
     120  int               count;               //!< The current count of Particles.
     121  PARTICLE_TYPE     particleType;        //!< A type for all the Particles
     122  Material*         material;            //!< A Material for all the Particles.
     123  Particle*         particles;           //!< A list of particles of this System.
     124  Particle*         deadList;            //!< A list of dead Particles in the System.
    126125
    127   GLuint* glID;              //!< A List of different gl-List-ID's
    128   GLuint dialectCount;       //!< How many different types of particles are there in the Particle System 
     126  GLuint*           glID;                //!< A List of different gl-List-ID's
     127  GLuint            dialectCount;        //!< How many different types of particles are there in the Particle System 
    129128
    130129  // per particle attributes
    131   QuickAnimation radiusAnim;
    132   QuickAnimation randRadiusAnim;
    133   QuickAnimation massAnim;
    134   QuickAnimation randMassAnim;
    135   QuickAnimation colorAnim[4];
     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)
    136135};
    137136
Note: See TracChangeset for help on using the changeset viewer.