Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4725 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jun 28, 2005, 8:51:49 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more load-params for Particles

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

Legend:

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

    r4693 r4725  
    2626
    2727using namespace std;
     28
     29
     30CREATE_FACTORY(ParticleEmitter);
    2831
    2932
     
    9497  LoadParam<ParticleEmitter>(root, "emission-velocity", this, &ParticleEmitter::setEmissionVelocity)
    9598    .describe("How fast the particles are emittet (their initial speed)");
     99
     100  LoadParam<ParticleEmitter>(root, "emission-momentum", this, &ParticleEmitter::setEmissionMomentum)
     101      .describe("How fast the particles rotation is at emissiontime (their initial momentum)");
    96102
    97103  LoadParam<ParticleEmitter>(root, "spread", this, &ParticleEmitter::setSpread)
  • orxonox/trunk/src/lib/particles/particle_system.cc

    r4716 r4725  
    3030#include "tinyxml.h"
    3131
     32CREATE_FACTORY(ParticleSystem);
     33
     34
    3235using namespace std;
    3336
     
    5255{
    5356  this->init();
     57
    5458  this->loadParams(root);
    5559}
     
    116120
    117121  //LoadParam<ParticleSystem>(root, "type", this, &ParticleSystem::setType);
    118   LoadParam<ParticleSystem>(root, "life-span", this, &ParticleSystem::setLifeSpan);
    119   LoadParam<ParticleSystem>(root, "conserve", this, &ParticleSystem::setConserve);
    120 //   void setLifeSpan(float lifeSpan, float randomLifeSpan = 0.0);
    121 //   void setConserve(float conserve);
    122 //
    123 //   /* Per-Particle-Attributes */
    124 //   void setRadius(float lifeCycleTime, float radius, float randRadius = 0.0);
    125 //   void setMass(float lifeCycleTime, float mass, float randMass = 0.0);
    126 //   void setColor(float lifeCycleTime, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
    127 
     122  LoadParam<ParticleSystem>(root, "life-span", this, &ParticleSystem::setLifeSpan)
     123      .describe("sets the life-span of the Particles.");
     124
     125  LoadParam<ParticleSystem>(root, "conserve", this, &ParticleSystem::setConserve)
     126      .describe("sets the Conserve facrot of the Particles (1.0: they keep all their energy, 0.0:they keep no energy)");
     127
     128  LoadParam<ParticleSystem>(root, "type", this, &ParticleSystem::setType)
     129      .describe("sets the type of the Particles, (DOT, SPARK, SPRITE or MODEL)");
     130
     131  LoadParam<ParticleSystem>(root, "model", this, &ParticleSystem::setModel)
     132      .describe("sets a model to be loaded on top of this System (also sets type to Model)");
     133
     134  // PER-PARTICLE-ATTRIBUTES:
     135  LoadParam<ParticleSystem>(root, "radius", this, &ParticleSystem::setRadius)
     136      .describe("The Radius of each particle over time (TimeIndex [0-1], radius at TimeIndex, randomRadius at TimeIndex)");
     137
     138  LoadParam<ParticleSystem>(root, "mass", this, &ParticleSystem::setMass)
     139      .describe("The Mass of each particle over time (TimeIndex: [0-1], mass at TimeIndex, randomMass at TimeIndex)");
     140
     141  LoadParam<ParticleSystem>(root, "color", this, &ParticleSystem::setColor)
     142      .describe("The Color of each particle over time (TimeIndex: [0-1], red: [0-1], green: [0-1], blue: [0-1], alpha: [0-1])");
     143}
     144/**
     145   \param particleType the type of particles in this System
     146   \param count how many particles (in PARTICLE_MULTI-mode)
     147   \todo this will be different
     148*/
     149void ParticleSystem::setType(const char* particleType)
     150{
     151  if (strcmp(particleType, "DOTS"))
     152    this->setType(PARTICLE_DOT);
     153  else if (strcmp(particleType, "SPARKS"))
     154    this->setType(PARTICLE_SPARK);
     155  else if (strcmp(particleType, "MODELS"))
     156    this->setType(PARTICLE_MODEL);
     157  else // if (strcmp(particleType, "SPRITE"))
     158    this->setType(PARTICLE_SPRITE);
    128159}
    129160
     
    255286   \param alpha: alpha
    256287*/
    257 void ParticleSystem::setColor(float lifeCycleTime, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
     288void ParticleSystem::setColor(float lifeCycleTime, float red, float green, float blue, float alpha)
    258289{
    259290  this->colorAnim[0].changeEntry(lifeCycleTime, red);
  • orxonox/trunk/src/lib/particles/particle_system.h

    r4691 r4725  
    7676  void loadParams(const TiXmlElement* root);
    7777
     78  void setType(const char* particleType);
    7879  void setType(PARTICLE_TYPE particleType, int count = 0);
    7980  void setMaterial(Material* material);
     
    8586  void setRadius(float lifeCycleTime, float radius, float randRadius = 0.0);
    8687  void setMass(float lifeCycleTime, float mass, float randMass = 0.0);
    87   void setColor(float lifeCycleTime, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
     88  void setColor(float lifeCycleTime, float red, float green, float blue, float alpha);
    8889
    8990  /** \returns the Type of the particles */
     
    127128  PARTICLE_TYPE     particleType;        //!< A type for all the Particles
    128129  Material*         material;            //!< A Material for all the Particles.
    129   Model*            model;               //!< A Model to be displayed (PARTICLE_MODEL)
    130130  Particle*         particles;           //!< A list of particles of this System.
    131131  Particle*         deadList;            //!< A list of dead Particles in the System.
Note: See TracChangeset for help on using the changeset viewer.