Changeset 4639 in orxonox.OLD for orxonox/trunk/src/lib/particles
- Timestamp:
- Jun 16, 2005, 1:59:25 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib/particles
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/particles/particle_emitter.cc
r4597 r4639 42 42 this->setEmissionRate(emissionRate); 43 43 this->setEmissionVelocity(velocity); 44 45 ParticleEngine::getInstance()->addEmitter(this); 44 46 } 45 47 … … 129 131 { 130 132 if (!strcmp(type, "plane")) 131 this-> type = EMITTER_PLANE;133 this->setType(EMITTER_PLANE); 132 134 else if (!strcmp(type, "cube")) 133 this-> type = EMITTER_CUBE;135 this->setType(EMITTER_CUBE); 134 136 else if (!strcmp(type, "sphere")) 135 this->type = EMITTER_SPHERE; 136 else 137 this->type = EMITTER_DOT; 137 this->setType(EMITTER_SPHERE); 138 else 139 this->setType(EMITTER_DOT); 140 } 141 142 const char* ParticleEmitter::getTypeC(void) const 143 { 144 if (this->type == EMITTER_PLANE) 145 return "EMITTER_PLANE"; 146 else if (this->type == EMITTER_CUBE) 147 return "EMITTER_CUBE"; 148 else if (this->type == EMITTER_SPHERE) 149 return "EMITTER_SPHERE"; 150 else 151 return "EMITTER_DOT"; 152 153 138 154 } 139 155 … … 262 278 \brief outputs some nice debug information 263 279 */ 264 void ParticleEmitter::debug(void) 280 void ParticleEmitter::debug(void) const 265 281 { 266 282 PRINT(0)(" Emitter %s\n", this->getName()); 267 } 283 PRINT(0)(" EmissionRate: %f, Speed: %f, SpreadAngle: %f\n", this->getEmissionRate(), this->getEmissionVelocity(), this->getSpread()); 284 PRINT(0)(" Size %f, Type: %s\n", this->getSize(), this->getTypeC()); 285 } -
orxonox/trunk/src/lib/particles/particle_emitter.h
r4597 r4639 49 49 /** \returns the type of the emitter */ 50 50 inline EMITTER_TYPE getType(void) const { return this->type; }; 51 /** \returns the Type as a const char * */ 52 const char* getTypeC(void) const; 51 53 /** \returns the Size of the emitter */ 52 54 inline float getSize(void) const { return this->emitterSize; }; … … 56 58 inline float getInheritSpeed(void) const { return this->inheritSpeed; }; 57 59 /** \returns the SpreadAngle of the emitter */ 58 inline float getSpread(void) { return this->angle; };60 inline float getSpread(void) const { return this->angle; }; 59 61 /** \returns the EmissionVelocity of the emitter */ 60 inline float getEmissionVelocity(void) { return this->velocity; };62 inline float getEmissionVelocity(void) const { return this->velocity; }; 61 63 62 void debug(void) ;64 void debug(void) const; 63 65 64 66 -
orxonox/trunk/src/lib/particles/particle_engine.cc
r4597 r4639 357 357 PRINT(0)(" Reference: %p\n", ParticleEngine::singletonRef); 358 358 PRINT(0)(" Count: Emitters: %d; Systems: %d, Connections: %d\n", 359 this->emitterList->getSize(), this->systemList->getSize(), this->connectionList->getSize()); 359 this->emitterList->getSize(), this->systemList->getSize(), this->connectionList->getSize()); 360 360 361 if (this->connectionList->getSize() > 0) 361 { 362 PRINT(0)(" Connections:\n"); 363 PRINT(0)(" -----------------------------------\n"); 364 365 tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator(); 366 ParticleConnection* tmpConnection = tmpConIt->nextElement(); 367 while(tmpConnection) 368 { 369 PRINT(0)(" Emitter '%s' emitts into System '%s'\n", tmpConnection->emitter->getName(), tmpConnection->system->getName()); 370 tmpConnection = tmpConIt->nextElement(); 371 } 372 delete tmpConIt; 373 } 362 { 363 PRINT(0)(" Connections:\n"); 364 PRINT(0)(" -----------------------------------\n"); 365 366 tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator(); 367 ParticleConnection* tmpConnection = tmpConIt->nextElement(); 368 while(tmpConnection) 369 { 370 PRINT(0)(" Emitter '%s' emitts into System '%s'\n", tmpConnection->emitter->getName(), tmpConnection->system->getName()); 371 tmpConnection = tmpConIt->nextElement(); 372 } 373 delete tmpConIt; 374 } 375 374 376 if (this->systemList->getSize() > 0) 375 { 376 tIterator<ParticleSystem>* tmpIt = systemList->getIterator(); 377 ParticleSystem* tmpSys = tmpIt->nextElement(); 378 while(tmpSys) 379 { 380 tmpSys->debug(); 381 tmpSys = tmpIt->nextElement(); 382 } 383 delete tmpIt; 384 } 377 { 378 tIterator<ParticleSystem>* tmpIt = systemList->getIterator(); 379 ParticleSystem* tmpSys = tmpIt->nextElement(); 380 while(tmpSys) 381 { 382 tmpSys->debug(); 383 tmpSys = tmpIt->nextElement(); 384 } 385 delete tmpIt; 386 } 387 else 388 { 389 PRINT(0)("NO SYSTEMS\n"); 390 } 391 if (this->emitterList->getSize() > 0) 392 { 393 tIterator<ParticleEmitter>* tmpIt = emitterList->getIterator(); 394 ParticleEmitter* tmpEmit = tmpIt->nextElement(); 395 while(tmpEmit) 396 { 397 tmpEmit->debug(); 398 tmpEmit = tmpIt->nextElement(); 399 } 400 delete tmpIt; 401 } 402 else 403 { 404 PRINTF(0)("NO EMITTERS\n"); 405 } 385 406 386 407 PRINT(0)("+--------------------------------PE-+\n");
Note: See TracChangeset
for help on using the changeset viewer.