Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

orxonox/trunk: more loading procedures, fixed small bugs in loadparam

File:
1 edited

Legend:

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

    r4725 r4726  
    3030CREATE_FACTORY(ParticleEmitter);
    3131
    32 
    3332/**
    3433   \brief standard constructor
     
    3736                  float velocity)
    3837{
    39   this->setClassID(CL_PARTICLE_EMITTER, "ParticleEmitter");
    40   this->type = EMITTER_DOT;
    41   this->emitterSize = 1.0;
     38  this->init();
     39
    4240  this->direction = direction;
    43   this->setInheritSpeed(0);
    4441  this->setSpread(angle);
    4542  this->setEmissionRate(emissionRate);
     
    5552ParticleEmitter::ParticleEmitter(const TiXmlElement* root)
    5653{
    57    this->setClassID(CL_PARTICLE_EMITTER, "ParticleEmitter");
    58 
    59    this->saveTime = 0.0;
     54  this->init();
    6055
    6156   if (root)
     
    7671
    7772/**
     73  \brief initializes default values of a ParitcleEmitter
     74*/
     75void ParticleEmitter::init()
     76{
     77  this->setClassID(CL_PARTICLE_EMITTER, "ParticleEmitter");
     78
     79  this->type = PARTICLE_EMITTER_DEFAULT_TYPE;
     80  this->emitterSize = PARTICLE_EMITTER_DEFAULT_SIZE;
     81  this->setInheritSpeed(PARTICLE_EMITTER_DEFAULT_INHERIT_SPEED);
     82  this->setEmissionRate(PARTICLE_EMITTER_DEFAULT_EMISSION_RATE);
     83  this->setSize(PARTICLE_EMITTER_DEFAULT_SIZE);
     84
     85  this->saveTime = 0.0;
     86}
     87
     88/**
    7889   \brief loads a ParticleEmitter from a XML-element
    7990   \param root the XML-element to load from
     
    103114  LoadParam<ParticleEmitter>(root, "spread", this, &ParticleEmitter::setSpread)
    104115    .describe("The angle the particles are emitted from (angle, deviation)");
     116
     117
     118  LoadParam<ParticleEmitter>(root, "emission-direction", this, &ParticleEmitter::setDirection);
    105119}
    106120
Note: See TracChangeset for help on using the changeset viewer.