- Timestamp:
- Jan 29, 2006, 12:57:24 AM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/particles/spark_particles.cc
r6653 r6821 91 91 void SparkParticles::draw() const 92 92 { 93 glPushAttrib(GL_ENABLE_BIT);94 93 95 94 Particle* drawPart = particles; 96 95 97 96 glDepthMask(GL_FALSE); 97 glPushAttrib(GL_ENABLE_BIT); 98 98 99 99 glDisable(GL_LIGHTING); 100 glDisable(GL_TEXTURE_2D); 101 100 102 glEnable(GL_LINE_SMOOTH); 101 103 glEnable(GL_BLEND); 102 104 glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA); 103 105 106 glLineWidth(2.0); 104 107 glBegin(GL_LINES); 105 108 while (likely(drawPart != NULL)) 106 109 { 110 // printf("%f %f %f %f\n", drawPart->color[0], drawPart->color[1], drawPart->color[2], drawPart->color[3]); 107 111 glColor4fv(drawPart->color); 108 112 glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z); -
trunk/src/world_entities/projectiles/hyperblast.cc
r6813 r6821 44 44 this->setMinEnergy(1); 45 45 this->setHealthMax(10); 46 this->lifeSpan = 5; 46 this->lifeSpan = 1; 47 this->size = 4.0; 47 48 48 49 this->emitter = new ParticleEmitter(Vector(0,1,0), M_2_PI, 100, 5); 50 this->emitter->setType( EMITTER_CUBE ); 51 this->emitter->setSize(10); 49 52 this->emitter->setParent(this); 50 53 this->emitter->setSpread(M_PI, M_PI); … … 73 76 Hyperblast::explosionParticles = new SparkParticles(2000); 74 77 Hyperblast::explosionParticles->setName("HyperblastExplosionParticles"); 75 Hyperblast::explosionParticles->setLifeSpan( 5, .3);76 Hyperblast::explosionParticles->setRadius( 100.0, 10);77 Hyperblast::explosionParticles->setRadius( 20, 15.0);78 Hyperblast::explosionParticles->setRadius( 50.0, 10.0);79 Hyperblast::explosionParticles->setColor(0.0, 0,1,0,1);80 Hyperblast::explosionParticles->setColor(0.5, .8,. 8,0,.99);81 Hyperblast::explosionParticles->setColor(0.8, .8,. 8,.3,.99);78 Hyperblast::explosionParticles->setLifeSpan(2, .3); 79 Hyperblast::explosionParticles->setRadius(0.1, .1); 80 Hyperblast::explosionParticles->setRadius(0.2, .2); 81 Hyperblast::explosionParticles->setRadius(1.0, .1); 82 Hyperblast::explosionParticles->setColor(0.0, 1.0, .6, 0 ,1); 83 Hyperblast::explosionParticles->setColor(0.5, .8,.1,0,.6); 84 Hyperblast::explosionParticles->setColor(0.8, .8,.2,.3,.3); 82 85 Hyperblast::explosionParticles->setColor(1.0, 1,1,1,.0); 83 86 } 84 87 85 88 this->emitter->setSystem(Hyperblast::explosionParticles); 89 this->size = 4.0; 86 90 87 91 Hyperblast::explosionParticles->debug(); 88 92 this->updateNode(0); 89 this->emitter->setEmissionRate( 245.0);90 this->emitter->setEmissionVelocity( 10.0);93 this->emitter->setEmissionRate(5000.0); 94 this->emitter->setEmissionVelocity(50.0); 91 95 } 92 96 … … 116 120 if(this->tickLifeCycle(dt)) 117 121 this->deactivate(); 122 123 this->size *=(1 - (5.0*dt)); 124 125 if (this->lifeCycle > .1 && this->emitter->getEmissionRate() > 10.0) 126 this->emitter->setEmissionRate(0.0); 118 127 } 119 128 … … 138 147 this->getAbsDir().matrix (matrix); 139 148 glMultMatrixf((float*)matrix); 140 glScalef(2.0, 2.0, 2.0);149 glScalef(2.0, this->size, this->size); 141 150 this->getModel()->draw(); 142 151 -
trunk/src/world_entities/projectiles/hyperblast.h
r6811 r6821 38 38 39 39 ParticleEmitter* emitter; 40 float size; 40 41 41 42 WorldEntity* hitEntity; // FIXME TEMPORARY
Note: See TracChangeset
for help on using the changeset viewer.