Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4727 in orxonox.OLD for orxonox/trunk


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

orxonox/trunk: more loading procedures

Location:
orxonox/trunk/src
Files:
3 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 */
  • orxonox/trunk/src/story_entities/world.cc

    r4726 r4727  
    498498
    499499  // SYSTEM OF THE VULCANO
    500   ParticleSystem* vulcanSysFog = new ParticleSystem(10000, PARTICLE_SPRITE);
    501   vulcanSysFog->setLifeSpan(5, 2);
    502   vulcanSysFog->setRadius(0.0, 20.0, 10);
    503   vulcanSysFog->setRadius(.2, 50, 30);
    504   vulcanSysFog->setRadius(1.0, 200, 100);
    505   vulcanSysFog->setMass (0.0, 1.0);
    506   vulcanSysFog->setColor(0, 1, 1, 1, .5);
    507   vulcanSysFog->setColor(.5, .6, .6, .6, .2);
    508   vulcanSysFog->setColor(1, .0, .0, .0, 0);
    509 
    510   ParticleEmitter* vulcanEmitFog = new ParticleEmitter(Vector(0,1,0), .5, 200, 150);
    511   vulcanEmitFog->setEmissionVelocity(150, 50);
    512   vulcanEmitFog->setType(EMITTER_CUBE);
    513   vulcanEmitFog->setSize(40);
    514   vulcanEmitFog->setRelCoor(2460,105, 606);
    515   ParticleEngine::getInstance()->addConnection(vulcanEmitFog, vulcanSysFog);
     500//   ParticleSystem* vulcanSysFog = new ParticleSystem(10000, PARTICLE_SPRITE);
     501//   vulcanSysFog->setLifeSpan(5, 2);
     502//   vulcanSysFog->setRadius(0.0, 20.0, 10);
     503//   vulcanSysFog->setRadius(.2, 50, 30);
     504//   vulcanSysFog->setRadius(1.0, 200, 100);
     505//   vulcanSysFog->setMass (0.0, 1.0);
     506//   vulcanSysFog->setColor(0, 1, 1, 1, .5);
     507//   vulcanSysFog->setColor(.5, .6, .6, .6, .2);
     508//   vulcanSysFog->setColor(1, .0, .0, .0, 0);
     509//
     510//   ParticleEmitter* vulcanEmitFog = new ParticleEmitter(Vector(0,1,0), .5, 200, 150);
     511//   vulcanEmitFog->setEmissionVelocity(150, 50);
     512//   vulcanEmitFog->setType(EMITTER_CUBE);
     513//   vulcanEmitFog->setSize(40);
     514//   vulcanEmitFog->setRelCoor(2460,105, 606);
     515//   ParticleEngine::getInstance()->addConnection(vulcanEmitFog, vulcanSysFog);
    516516
    517517
Note: See TracChangeset for help on using the changeset viewer.