Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 16, 2005, 12:55:19 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: reimplemented the lifeTime function of particles (a little bit slower, but much more efficient)
Color also implemented with the new TimeCode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/lib/graphics/particles/particle_system.h

    r4186 r4192  
    3636typedef struct Particle
    3737{
    38   float timeToLive;           //!< The time this particle lives from NOW on.
     38  float lifeTime;             //!< The time this particle has to live.
     39  float lifeCycle;            //!< The fraction of time passed. (in percentage of its lifeTime)
     40
    3941  Vector position;            //!< The current position of this particle.
    4042  Vector velocity;            //!< The current velocity of this particle.
     
    4446  float radius;               //!< The current size of this particle.
    4547  float radiusIt;             //!< The difference of the Size per second.
     48
     49  GLfloat color [4];          //!< A Color for the particles.
    4650
    4751  PARTICLE_TYPE type;
     
    7074  void setMass(float mass, float randomMass);
    7175
     76  void setColor(GLfloat br, GLfloat bg, GLfloat bb, GLfloat ba,
     77                GLfloat mr, GLfloat mg, GLfloat mb, GLfloat ma,
     78                GLfloat er, GLfloat eg, GLfloat eb, GLfloat ea);
     79
    7280  void applyField(float dt, Field* field);
    7381
     
    8290  float conserve;            //!< How much energy gets conserved to the next Tick.
    8391  float lifeSpan;            //!< Initial lifetime of a Particle.
    84   float randomLifeSpan;
    85   float startRadius;
    86   float endRadius;
    87   float randomStartRadius;
    88   float randomEndRadius;
    89   float initialMass;
    90   float randomInitialMass;
    91   float inheritSpeed;
     92  float randomLifeSpan;      //!< A random value for the Lifespan (around the initial lifetime)
     93  float startRadius;         //!< The beginning Radius of the Particle
     94  float endRadius;           //!< The end Radius of the Particle
     95  float randomStartRadius;   //!< The Random start Radius (begin + rand*randomValue)
     96  float randomEndRadius;     //!< Random end value
     97  float initialMass;         //!< The initial Mass of the Particle
     98  float randomInitialMass;   //!< The random initial Mass of the Particle
     99  float inheritSpeed;        //!< How much speed the particle inherits from the Emitters speed \todo move this to the emitter
     100
     101  GLfloat startColor[4];     //!< Color of the Particle at the beginning
     102  GLfloat midColor[4];       //!< Color of the Particle at the middle of its lifeSpan
     103  GLfloat endColor[4];       //!< Color of the Particle at the end of its lifeSpan
    92104
    93105  // particles
Note: See TracChangeset for help on using the changeset viewer.