Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4430 in orxonox.OLD for orxonox/trunk/src/lib/particles


Ignore:
Timestamp:
Jun 1, 2005, 10:19:38 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: mass and radius are animateable

Location:
orxonox/trunk/src/lib/particles
Files:
2 edited

Legend:

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

    r4421 r4430  
    5353  this->setInheritSpeed(0);
    5454  this->glID = NULL;
    55   this->setRadius(1.0, 1.0, 0.0);
    5655  this->setType(type, 1);
    57   this->setColor(1.0,1.0,1.0,1.0, .5,.5,.5,.5, .0,.0,.0,.0);
    58   this->setMass(1.0, 0.0);
     56  //  this->setColor(1.0,1.0,1.0,1.0, .5,.5,.5,.5, .0,.0,.0,.0);
    5957  ParticleEngine::getInstance()->addSystem(this);
    60 
    61   radiusAnim.addEntry(0.0,5);
    62 
    63   radiusAnim.addEntry(.80,3);
    64 
    65   radiusAnim.addEntry(.5, 0);
    6658}
    6759
     
    148140}
    149141
    150 
    151 
    152142/**
    153143   \brief how much of the speed from the ParticleEmitter should flow onto the ParticleSystem
     
    178168
    179169/**
    180    \brief sets the radius of newly created particles
    181 */
    182 void ParticleSystem::setRadius(float startRadius, float endRadius, float randomStartRadius, float randomEndRadius)
    183 {
    184   this->startRadius = startRadius;
    185   this->endRadius = endRadius;
    186   this->randomStartRadius = randomStartRadius;
    187   this->randomEndRadius = randomEndRadius;
    188 }
    189 
    190 /**
    191    \brief sets the initial mass of any particle
    192 */
    193 void ParticleSystem::setMass(float mass, float randomMass)
    194 {
    195   this->initialMass = mass;
    196   this->randomInitialMass = randomMass;
    197 }
    198 
    199 /**
    200170   \brief sets the conserve Factor of newly created particles
    201171*/
     
    210180}
    211181
     182/////////////////////////////
     183/* Per-Particle Attributes */
     184/////////////////////////////
     185/**
     186   \brief sets a key in the radius-animation on a per-particle basis
     187   \param lifeCycleTime the time (partilceLifeTime/particleAge) [0-1]
     188   \param radius the radius at this position
     189   \param randRadius the randRadius at this position
     190*/
     191void ParticleSystem::setRadius(float lifeCycleTime, float radius, float randRadius)
     192{
     193  this->radiusAnim.addEntry(lifeCycleTime, radius);
     194  this->randRadiusAnim.addEntry(lifeCycleTime, randRadius);
     195}
     196
     197/**
     198   \brief sets a key in the mass-animation on a per-particle basis
     199   \param lifeCycleTime the time (partilceLifeTime/particleAge) [0-1]
     200   \param mass the mass at this position
     201   \param randMass the randomMass at this position
     202*/
     203void ParticleSystem::setMass(float lifeCycleTime, float mass, float randMass)
     204{
     205  this->massAnim.addEntry(lifeCycleTime, mass);
     206  this->randMassAnim.addEntry(lifeCycleTime, randMass);
     207}
    212208
    213209/**
  • orxonox/trunk/src/lib/particles/particle_system.h

    r4421 r4430  
    7474  void setInheritSpeed(float value);
    7575  void setLifeSpan(float lifeSpan, float randomLifeSpan = 0.0);
    76   void setRadius(float startRadius, float endRadius,
    77                  float randomStartRadius = 0.0, float randomEndRadius = 0.0);
    7876  void setConserve(float conserve);
    79   void setMass(float mass, float randomMass = 0.0);
    8077
     78  /* Per-Particle-Attributes */
     79  void setRadius(float lifeCycleTime, float radius, float randRadius = 0.0);
     80  void setMass(float lifeCycleTime, float mass, float randMass = 0.0);
    8181  void setColor(GLfloat br, GLfloat bg, GLfloat bb, GLfloat ba,
    8282                GLfloat mr, GLfloat mg, GLfloat mb, GLfloat ma,
    8383                GLfloat er, GLfloat eg, GLfloat eb, GLfloat ea);
     84
     85
    8486
    8587  /** \returns the Type of the particles */
     
    140142
    141143  QuickAnimation radiusAnim;
     144  QuickAnimation randRadiusAnim;
     145  QuickAnimation massAnim;
     146  QuickAnimation randMassAnim;
     147  QuickAnimation colorAnim[4];
    142148};
    143149
Note: See TracChangeset for help on using the changeset viewer.