Changeset 6629 in orxonox.OLD for trunk/src/lib/particles/particle_system.cc
- Timestamp:
- Jan 20, 2006, 8:11:04 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/particles/particle_system.cc
r6626 r6629 74 74 75 75 /** 76 \brief initializes the ParticleSystem with default values77 */76 * @brief initializes the ParticleSystem with default values 77 */ 78 78 void ParticleSystem::init() 79 79 { … … 125 125 } 126 126 LOAD_PARAM_END_CYCLE(element); 127 128 LoadParam(root, "precache", this, ParticleSystem, precache) 129 .describe("Precaches the ParticleSystem for %1 seconds, %2 times per Second") 130 .defaultValues(2, 1, 25); 127 131 } 128 132 … … 222 226 } 223 227 224 228 /** 229 * @brief adds an Emitter to this System. 230 * @param emitter the Emitter to add. 231 */ 225 232 void ParticleSystem::addEmitter(ParticleEmitter* emitter) 226 233 { … … 232 239 } 233 240 234 241 /** 242 * @brief removes a ParticleEmitter from this System 243 * @param emitter the Emitter to remove 244 */ 235 245 void ParticleSystem::removeEmitter(ParticleEmitter* emitter) 236 246 { … … 244 254 245 255 /** 256 * @brief does a Precaching, meaning, that the ParticleSystem(and its emitters) will be ticked force 257 * @param seconds: seconds 258 * @param ticksPerSeconds times per Second. 259 */ 260 void ParticleSystem::precache(unsigned int seconds, unsigned int ticksPerSecond) 261 { 262 PRINTF(4)("Precaching %s::%s %d seconds %d timesPerSecond\n", this->getClassName(), this->getName(), seconds, ticksPerSecond); 263 this->debug(); 264 for (unsigned int i = 0; i < seconds*ticksPerSecond; i++) 265 this->tick(1.0/(float)ticksPerSecond); 266 } 267 268 269 /** 246 270 * ticks the system. 247 271 * @param dt the time to tick all the Particles of the System … … 355 379 // switch (this->particleType) 356 380 // { 357 // case PARTICLE_SPARK:358 // glDisable(GL_LIGHTING);359 // glDepthMask(GL_FALSE);360 // //glEnable(GL_LINE_SMOOTH);361 // glEnable(GL_BLEND);362 //363 // glBegin(GL_LINES);364 // while (likely(drawPart != NULL))365 // {366 // glColor4fv(drawPart->color);367 // glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z);368 // glVertex3f(drawPart->position.x - drawPart->velocity.x * drawPart->radius,369 // drawPart->position.y - drawPart->velocity.y * drawPart->radius,370 // drawPart->position.z - drawPart->velocity.z * drawPart->radius);371 // drawPart = drawPart->next;372 // }373 // glEnd();374 // break;375 381 // 376 382 // case PARTICLE_MODEL: 377 383 // { 378 // GLfloat matrix[4][4];379 //380 // if (likely(this->getModel() != NULL))381 // while (likely(drawPart != NULL))382 // {383 // glPushMatrix();384 // glMatrixMode(GL_MODELVIEW);385 // /* move */386 // glTranslatef(drawPart->position.x, drawPart->position.y, drawPart->position.z);387 // /* scale */388 // glScalef(drawPart->radius, drawPart->radius, drawPart->radius);389 // /* rotate */390 // drawPart->orientation.matrix (matrix);391 // glMultMatrixf((float*)matrix);392 //393 // this->getModel()->draw();394 //395 // glPopMatrix();396 // drawPart = drawPart->next;397 // }398 // else399 // PRINTF(2)("no model loaded onto ParticleSystem-%s\n", this->getName());400 384 // } 401 385 // break; … … 488 472 void ParticleSystem::debug() const 489 473 { 490 PRINT(0)(" ParticleCount: %d , maximumCount: %d :: filled %d%%\n", this->count, this->maxCount, 100*this->count/this->maxCount);474 PRINT(0)(" ParticleCount: %d emitters: %d, maximumCount: %d :: filled %d%%\n", this->count, this->emitters.size(), this->maxCount, 100*this->count/this->maxCount); 491 475 if (deadList) 492 476 {
Note: See TracChangeset
for help on using the changeset viewer.