Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6821 in orxonox.OLD for trunk


Ignore:
Timestamp:
Jan 29, 2006, 12:57:24 AM (19 years ago)
Author:
bensch
Message:

trunk: HyperBlaster

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/particles/spark_particles.cc

    r6653 r6821  
    9191void SparkParticles::draw() const
    9292{
    93   glPushAttrib(GL_ENABLE_BIT);
    9493
    9594  Particle* drawPart = particles;
    9695
    9796  glDepthMask(GL_FALSE);
     97  glPushAttrib(GL_ENABLE_BIT);
    9898
    9999  glDisable(GL_LIGHTING);
     100  glDisable(GL_TEXTURE_2D);
     101
    100102  glEnable(GL_LINE_SMOOTH);
    101103  glEnable(GL_BLEND);
    102104  glBlendFunc(GL_SRC_ALPHA, GL_DST_ALPHA);
    103105
     106  glLineWidth(2.0);
    104107  glBegin(GL_LINES);
    105108  while (likely(drawPart != NULL))
    106109  {
     110  //    printf("%f %f %f %f\n", drawPart->color[0], drawPart->color[1], drawPart->color[2], drawPart->color[3]);
    107111    glColor4fv(drawPart->color);
    108112    glVertex3f(drawPart->position.x, drawPart->position.y, drawPart->position.z);
  • trunk/src/world_entities/projectiles/hyperblast.cc

    r6813 r6821  
    4444  this->setMinEnergy(1);
    4545  this->setHealthMax(10);
    46   this->lifeSpan = 5;
     46  this->lifeSpan = 1;
     47  this->size = 4.0;
    4748
    4849  this->emitter = new ParticleEmitter(Vector(0,1,0), M_2_PI, 100, 5);
     50  this->emitter->setType( EMITTER_CUBE );
     51  this->emitter->setSize(10);
    4952  this->emitter->setParent(this);
    5053  this->emitter->setSpread(M_PI, M_PI);
     
    7376    Hyperblast::explosionParticles = new SparkParticles(2000);
    7477    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);
    8285    Hyperblast::explosionParticles->setColor(1.0, 1,1,1,.0);
    8386  }
    8487
    8588  this->emitter->setSystem(Hyperblast::explosionParticles);
     89  this->size = 4.0;
    8690
    8791  Hyperblast::explosionParticles->debug();
    8892  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);
    9195}
    9296
     
    116120  if(this->tickLifeCycle(dt))
    117121    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);
    118127}
    119128
     
    138147  this->getAbsDir().matrix (matrix);
    139148  glMultMatrixf((float*)matrix);
    140   glScalef(2.0, 2.0, 2.0);
     149  glScalef(2.0, this->size, this->size);
    141150  this->getModel()->draw();
    142151
  • trunk/src/world_entities/projectiles/hyperblast.h

    r6811 r6821  
    3838
    3939    ParticleEmitter*                  emitter;
     40    float                             size;
    4041
    4142    WorldEntity* hitEntity; // FIXME TEMPORARY
Note: See TracChangeset for help on using the changeset viewer.