Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6811 in orxonox.OLD for trunk/src/world_entities/projectiles


Ignore:
Timestamp:
Jan 28, 2006, 4:02:06 PM (19 years ago)
Author:
bensch
Message:

More stuff in Cannon and Hyperblast

Location:
trunk/src/world_entities/projectiles
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/projectiles/hyperblast.cc

    r6810 r6811  
    4040
    4141  float modelSize = .3;
    42   this->loadModel("models/projectiles/orx-hyperblast.obj", .3);
     42  this->loadModel("models/projectiles/hyperblast.obj", 5);
    4343
    4444  this->setMinEnergy(1);
     
    5858{
    5959  /* this is normaly done by World.cc by deleting the ParticleEngine */
    60   if (Hyperblast::extParticles != NULL && ClassList::getList(CL_HYPERBLAST)->size() <= 1)
    61   {
    62     Hyperblast::extParticles = NULL;
    63   }
    6460  if (Hyperblast::explosionParticles != NULL && ClassList::getList(CL_HYPERBLAST)->size() <= 1)
    6561  {
     
    6965}
    7066
    71 SpriteParticles* Hyperblast::extParticles = NULL;
    7267SparkParticles* Hyperblast::explosionParticles = NULL;
    7368
    7469void Hyperblast::activate()
    7570{
    76   if (unlikely(Hyperblast::extParticles == NULL))
    77   {
    78     Hyperblast::extParticles = new SpriteParticles(2000);
    79     Hyperblast::extParticles->setName("HyperblastTrailParticles");
    80     Hyperblast::extParticles->setMaterialTexture("maps/radial-trans-noise.png");
    81     Hyperblast::extParticles->setLifeSpan(1.0, .3);
    82     Hyperblast::extParticles->setRadius(0.0, .5);
    83     Hyperblast::extParticles->setRadius(0.2, 2.0);
    84     Hyperblast::extParticles->setRadius(.5, .8);
    85     Hyperblast::extParticles->setRadius(1.0, .8);
    86     Hyperblast::extParticles->setColor(0.0, 1,0,0,.7);
    87     Hyperblast::extParticles->setColor(0.2, .8,.8,0,.5);
    88     Hyperblast::extParticles->setColor(0.5, .8,.8,.8,.8);
    89     Hyperblast::extParticles->setColor(1.0, .8,.8,.8,.0);
    90   }
    9171  if (unlikely(Hyperblast::explosionParticles == NULL))
    9272  {
     
    10383  }
    10484
    105   this->emitter->setSystem(Hyperblast::extParticles);
     85  this->emitter->setSystem(Hyperblast::explosionParticles);
    10686
    10787  this->updateNode(0);
    108   this->emitter->setEmissionRate(45.0);
     88  this->emitter->setEmissionRate(245.0);
    10989  this->emitter->setEmissionVelocity(0.0);
    11090}
     
    125105void Hyperblast::collidesWith(WorldEntity* entity, const Vector& location)
    126106{
    127   if (this->hitEntity != entity)
    128     this->destroy();
    129   this->hitEntity = entity;
    130107}
    131108
     
    136113void Hyperblast::tick (float dt)
    137114{
    138   //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1);
    139   Vector v = this->velocity * (dt);
    140   this->shiftCoor(v);
    141 
    142115  if(this->tickLifeCycle(dt))
    143116    this->deactivate();
     
    150123{
    151124  PRINTF(5)("DESTROY Hyperblast\n");
    152   this->lifeCycle = .95; //!< @todo calculate this usefully.
    153   this->emitter->setSystem(Hyperblast::explosionParticles);
    154125
    155   this->emitter->setEmissionRate(1000.0);
    156   this->emitter->setEmissionVelocity(50.0);
    157 //  this->deactivate();
    158126
    159127}
  • trunk/src/world_entities/projectiles/hyperblast.h

    r6810 r6811  
    1111class Vector;
    1212class Weapon;
    13 class SpriteParticles;
    1413class SparkParticles;
    1514class ParticleEmitter;
     
    3635  private:
    3736    static FastFactory*               fastFactory;
    38     static SpriteParticles*           extParticles;
    3937    static SparkParticles*            explosionParticles;
    4038
Note: See TracChangeset for help on using the changeset viewer.