Changeset 4725 in orxonox.OLD for orxonox/trunk/src/lib/particles
- Timestamp:
- Jun 28, 2005, 8:51:49 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/particles
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/particles/particle_emitter.cc
r4693 r4725 26 26 27 27 using namespace std; 28 29 30 CREATE_FACTORY(ParticleEmitter); 28 31 29 32 … … 94 97 LoadParam<ParticleEmitter>(root, "emission-velocity", this, &ParticleEmitter::setEmissionVelocity) 95 98 .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)"); 96 102 97 103 LoadParam<ParticleEmitter>(root, "spread", this, &ParticleEmitter::setSpread) -
orxonox/trunk/src/lib/particles/particle_system.cc
r4716 r4725 30 30 #include "tinyxml.h" 31 31 32 CREATE_FACTORY(ParticleSystem); 33 34 32 35 using namespace std; 33 36 … … 52 55 { 53 56 this->init(); 57 54 58 this->loadParams(root); 55 59 } … … 116 120 117 121 //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 */ 149 void 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); 128 159 } 129 160 … … 255 286 \param alpha: alpha 256 287 */ 257 void ParticleSystem::setColor(float lifeCycleTime, GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)288 void ParticleSystem::setColor(float lifeCycleTime, float red, float green, float blue, float alpha) 258 289 { 259 290 this->colorAnim[0].changeEntry(lifeCycleTime, red); -
orxonox/trunk/src/lib/particles/particle_system.h
r4691 r4725 76 76 void loadParams(const TiXmlElement* root); 77 77 78 void setType(const char* particleType); 78 79 void setType(PARTICLE_TYPE particleType, int count = 0); 79 80 void setMaterial(Material* material); … … 85 86 void setRadius(float lifeCycleTime, float radius, float randRadius = 0.0); 86 87 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); 88 89 89 90 /** \returns the Type of the particles */ … … 127 128 PARTICLE_TYPE particleType; //!< A type for all the Particles 128 129 Material* material; //!< A Material for all the Particles. 129 Model* model; //!< A Model to be displayed (PARTICLE_MODEL)130 130 Particle* particles; //!< A list of particles of this System. 131 131 Particle* deadList; //!< A list of dead Particles in the System.
Note: See TracChangeset
for help on using the changeset viewer.