Changeset 3944 in orxonox.OLD for orxonox/branches/particleEngine
- Timestamp:
- Apr 23, 2005, 2:48:57 PM (20 years ago)
- Location:
- orxonox/branches/particleEngine/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.cc
r3938 r3944 49 49 ParticleEmitter::~ParticleEmitter () 50 50 { 51 51 ParticleEngine::getInstance()->removeEmitter(this); 52 52 53 53 } … … 137 137 } 138 138 } 139 140 /** 141 \brief outputs some nice debug information 142 */ 143 void ParticleEmitter::debug(void) 144 { 145 146 } -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_emitter.h
r3935 r3944 36 36 void setVelocity(float velocity, float randomVelocity = 0.0); 37 37 38 void debug(void); 39 38 40 private: 39 41 Vector direction; //!< emition direction -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.cc
r3943 r3944 204 204 205 205 } 206 207 /** 208 \brief outputs some nice debug information 209 */ 210 void ParticleEngine::debug(void) 211 { 212 PRINT(0)("+-----------------------------------+\n"); 213 PRINT(0)("+ PARTICLE-ENGINE DEBUG INFORMATION +\n"); 214 PRINT(0)("+-----------------------------------+\n"); 215 PRINT(0)(" Reference: %p\n", ParticleEngine::singletonRef); 216 PRINT(0)(" Count: Emitters: %d; Systems: %d, Connections: %d\n", 217 this->emitterList->getSize(), this->systemList->getSize(), this->connectionList->getSize()); 218 if (this->connectionList->getSize() > 0) 219 { 220 PRINT(0)(" Connections:\n"); 221 PRINT(0)(" -----------------------------------\n"); 222 223 tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator(); 224 ParticleConnection* tmpConnection = tmpConIt->nextElement(); 225 while(tmpConnection) 226 { 227 PRINT(0)(" Emitter '%s' emitts into System '%s'\n", tmpConnection->emitter->getName(), tmpConnection->system->getName()); 228 tmpConnection = tmpConIt->nextElement(); 229 } 230 delete tmpConIt; 231 } 232 if (this->systemList->getSize() > 0) 233 { 234 tIterator<ParticleSystem>* tmpIt = systemList->getIterator(); 235 ParticleSystem* tmpSys = tmpIt->nextElement(); 236 while(tmpSys) 237 { 238 tmpSys->debug(); 239 tmpSys = tmpIt->nextElement(); 240 } 241 delete tmpIt; 242 } 243 244 PRINT(0)("+--------------------------------PE-+\n"); 245 246 } -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_engine.h
r3943 r3944 39 39 bool breakConnection(ParticleConnection* connection); 40 40 41 void debug(); 42 41 43 private: 42 44 ParticleEngine(void); -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.cc
r3943 r3944 35 35 { 36 36 this->setClassName ("ParticleSystem"); 37 37 this->name = NULL; 38 38 this->maxCount = maxCount; 39 39 this->count = 0; … … 58 58 // delete what has to be deleted here 59 59 ParticleEngine::getInstance()->removeSystem(this); 60 } 61 62 void ParticleSystem::setName(const char* name) 63 { 64 if (this->name) 65 delete this->name; 66 this->name = new char[strlen(name)+1]; 67 strcpy(this->name, name); 68 } 69 70 const char* ParticleSystem::getName(void) const 71 { 72 return this->name; 60 73 } 61 74 … … 248 261 } 249 262 263 264 /** 265 \brief outputs some nice debug information 266 */ 267 void ParticleSystem::debug(void) 268 { 269 PRINT(0)(" ParticleSystem %s\n", this->name); 270 PRINT(0)(" ParticleCount: %d, maximumCount: %d :: filled %d%%\n", this->count, this->maxCount, 100*this->count/this->maxCount); 271 } -
orxonox/branches/particleEngine/src/lib/graphics/particles/particle_system.h
r3942 r3944 47 47 ParticleSystem(unsigned int maxCount = PARTICLE_DEFAULT_MAX_COUNT, PARTICLE_TYPE type = PARTICLE_DEFAULT_TYPE); 48 48 virtual ~ParticleSystem(); 49 void setName(const char* name); 50 const char* getName(void) const; 49 51 50 52 void setType(PARTICLE_TYPE particleType, int count = 0); … … 59 61 void draw(void); 60 62 63 void debug(void); 64 61 65 private: 66 char* name; // the Name of the Particle System 67 62 68 float conserve; //!< How much energy gets conserved to the next Tick. 63 69 float lifeSpan; //!< Initial lifetime of a Particle. -
orxonox/branches/particleEngine/src/story_entities/world.cc
r3942 r3944 166 166 AnimationPlayer::getInstance()->debug(); 167 167 delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence. 168 168 169 ParticleEngine::getInstance()->debug(); 169 170 delete ParticleEngine::getInstance(); 170 171 … … 379 380 ParticleEmitter* testEmitter,* testEmitter2; 380 381 ParticleSystem* testSystem; 381 testEmitter = new ParticleEmitter(Vector(-1,0,0), M_PI_2, 120 0.0, .5);382 testEmitter = new ParticleEmitter(Vector(-1,0,0), M_PI_2, 120.0, .5); 382 383 testEmitter->setParent(localPlayer); 383 384 testEmitter->setRelCoor(Vector(-3, 0, 0)); 384 385 testSystem = new ParticleSystem(100000); 385 testEmitter->setName("ship emitter"); 386 testEmitter2 = new ParticleEmitter(Vector(1,0,0), .1, 120.0, 1); 387 testEmitter2->setParent(tn); 388 testEmitter2->setName("crap emitter"); 389 390 testSystem = new ParticleSystem(1000); 386 391 testSystem->setLifeSpan(1, .8); 387 392 testSystem->setRadius(1.0, 0.0, .5); 388 393 testSystem->setConserve(.8); 389 394 testSystem->setInheritSpeed(1); 390 395 testSystem->setName("system"); 391 396 ParticleEngine::getInstance()->addConnection(testEmitter, testSystem); 397 ParticleEngine::getInstance()->addConnection(testEmitter2, testSystem); 398 ParticleEngine::getInstance()->debug(); 392 399 393 400 break;
Note: See TracChangeset
for help on using the changeset viewer.