Changeset 4726 in orxonox.OLD for orxonox/trunk/src/lib/particles/particle_system.cc
- Timestamp:
- Jun 28, 2005, 10:33:14 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/particles/particle_system.cc
r4725 r4726 127 127 128 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)"); 129 .describe("sets the type of the Particles, (dot, spark, sprite or model)"); 133 130 134 131 // PER-PARTICLE-ATTRIBUTES: … … 149 146 void ParticleSystem::setType(const char* particleType) 150 147 { 151 if ( strcmp(particleType, "DOTS"))148 if (!strcmp(particleType, "dot")) 152 149 this->setType(PARTICLE_DOT); 153 else if (strcmp(particleType, "SPARKS"))150 else if(!strcmp(particleType, "spark")) 154 151 this->setType(PARTICLE_SPARK); 155 else if (strcmp(particleType, "MODELS"))152 else if(!strcmp(particleType, "model")) 156 153 this->setType(PARTICLE_MODEL); 157 154 else // if (strcmp(particleType, "SPRITE")) … … 187 184 // material->setTransparency(.5); 188 185 break; 189 case PARTICLE_MODEL: 190 if (!this->model) 191 { 192 PRINTF(2)("Model not loaded yet, please do this through ParticleSystem::loadModel()"); 193 this->setType(PARTICLE_SPRITE); 194 } 195 break; 196 } 186 } 197 187 } 198 188 … … 207 197 { 208 198 this->material = material; 209 }210 211 /**212 * sets a Model to the Particles213 * @param modelName the Name of the Model to load214 */215 void ParticleSystem::setModel(const char* modelName)216 {217 if (this->model)218 ResourceManager::getInstance()->unload(this->model);219 if (modelName)220 {221 this->model = (Model*)ResourceManager::getInstance()->load(modelName, OBJ, RP_LEVEL);222 this->setType(PARTICLE_MODEL);223 }224 else225 {226 this->model = NULL;227 this->setType(PARTICLE_SPRITE);228 }229 199 } 230 200 … … 505 475 drawPart = drawPart->next; 506 476 } 477 else 478 printf("no model loaded onto ParticleSystem-%s\n", this->getName()); 507 479 } 508 480 break; … … 595 567 void ParticleSystem::debug(void) const 596 568 { 597 PRINT(0)(" ParticleSystem %s\n", this->getName()); 569 PRINT(0)(" ParticleSystem %s, type: ", this->getName()); 570 { 571 if (this->particleType == PARTICLE_MODEL) 572 PRINT(0)("model"); 573 else if (this->particleType == PARTICLE_SPRITE) 574 PRINT(0)("sprite"); 575 else if (this->particleType == PARTICLE_DOT) 576 PRINT(0)("dot"); 577 else if (this->particleType == PARTICLE_SPARK) 578 PRINT(0)("spark"); 579 580 PRINT(0)("\n"); 581 } 582 598 583 PRINT(0)(" ParticleCount: %d, maximumCount: %d :: filled %d%%\n", this->count, this->maxCount, 100*this->count/this->maxCount); 599 584 if (deadList)
Note: See TracChangeset
for help on using the changeset viewer.