Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Jun 28, 2005, 10:58:18 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: more loading procedures

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

Legend:

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

    r4726 r4727  
    4444  this->init();
    4545
    46   this->maxCount = maxCount;
     46  this->setMaxCount(maxCount);
    4747  this->setType(type, 1);
    4848}
     
    9898  this->material = NULL;
    9999  this->model = NULL;
    100   this->maxCount = PARTICLE_DEFAULT_MAX_COUNT;
     100  this->setMaxCount(PARTICLE_DEFAULT_MAX_COUNT);
    101101  this->count = 0;
    102102  this->particles = NULL;
     
    119119  static_cast<PhysicsInterface*>(this)->loadParams(root);
    120120
     121  LoadParam<ParticleSystem>(root, "max-count", this, &ParticleSystem::setMaxCount)
     122      .describe("the maximal count of Particles, that can be emitted into this system");
     123
    121124  //LoadParam<ParticleSystem>(root, "type", this, &ParticleSystem::setType);
    122125  LoadParam<ParticleSystem>(root, "life-span", this, &ParticleSystem::setLifeSpan)
     
    126129      .describe("sets the Conserve facrot of the Particles (1.0: they keep all their energy, 0.0:they keep no energy)");
    127130
    128   LoadParam<ParticleSystem>(root, "type", this, &ParticleSystem::setType)
    129       .describe("sets the type of the Particles, (dot, spark, sprite or model)");
     131  const TiXmlElement* element = root->FirstChildElement();
     132  while (element != NULL)
     133  {
     134    LoadParam<ParticleSystem>(element, "type", this, &ParticleSystem::setType, true)
     135        .describe("sets the type of the Particles, (dot, spark, sprite or model)");
    130136
    131137  // PER-PARTICLE-ATTRIBUTES:
    132   LoadParam<ParticleSystem>(root, "radius", this, &ParticleSystem::setRadius)
    133       .describe("The Radius of each particle over time (TimeIndex [0-1], radius at TimeIndex, randomRadius at TimeIndex)");
    134 
    135   LoadParam<ParticleSystem>(root, "mass", this, &ParticleSystem::setMass)
    136       .describe("The Mass of each particle over time (TimeIndex: [0-1], mass at TimeIndex, randomMass at TimeIndex)");
    137 
    138   LoadParam<ParticleSystem>(root, "color", this, &ParticleSystem::setColor)
    139       .describe("The Color of each particle over time (TimeIndex: [0-1], red: [0-1], green: [0-1], blue: [0-1], alpha: [0-1])");
    140 }
     138    LoadParam<ParticleSystem>(element, "radius", this, &ParticleSystem::setRadius, true)
     139        .describe("The Radius of each particle over time (TimeIndex [0-1], radius at TimeIndex, randomRadius at TimeIndex)");
     140
     141    LoadParam<ParticleSystem>(element, "mass", this, &ParticleSystem::setMass, true)
     142        .describe("The Mass of each particle over time (TimeIndex: [0-1], mass at TimeIndex, randomMass at TimeIndex)");
     143
     144    LoadParam<ParticleSystem>(element, "color", this, &ParticleSystem::setColor, true)
     145        .describe("The Color of each particle over time (TimeIndex: [0-1], red: [0-1], green: [0-1], blue: [0-1], alpha: [0-1])");
     146    element = element->NextSiblingElement();
     147  }
     148
     149}
     150
     151/**
     152  \param maxCount the maximum count of particles that can be emitted
     153 */
     154void ParticleSystem::setMaxCount(int maxCount)
     155{
     156  this->maxCount = maxCount;
     157}
     158
     159
    141160/**
    142161   \param particleType the type of particles in this System
  • orxonox/trunk/src/lib/particles/particle_system.h

    r4725 r4727  
    8282  void setLifeSpan(float lifeSpan, float randomLifeSpan = 0.0);
    8383  void setConserve(float conserve);
     84  void setMaxCount(int maxCount);
    8485
    8586  /* Per-Particle-Attributes */
Note: See TracChangeset for help on using the changeset viewer.