Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6811 in orxonox.OLD for trunk


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
Files:
5 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
  • trunk/src/world_entities/space_ships/hover.cc

    r6807 r6811  
    7676  Weapon* wpLeft = new TestGun(1);
    7777  wpLeft->setName("testGun Left");
    78   Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_CANNON));
     78  Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_HYPERBLASTER));
    7979
    8080  cannon->setName("BFG");
  • trunk/src/world_entities/weapons/cannon.cc

    r6803 r6811  
    7474//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
    7575
    76   this->loadModel("models/guns/plasmadriver_#.obj", 2.0);
     76  this->loadModel("models/guns/cannon.obj", 1.0);
    7777
    7878  this->setStateDuration(WS_SHOOTING, 2.0);
  • trunk/src/world_entities/weapons/hyperblaster.cc

    r6810 r6811  
    6666  this->setStateDuration(WS_SHOOTING, 2.0);
    6767  this->setStateDuration(WS_RELOADING, 5.0);
    68   this->setStateDuration(WS_ACTIVATING, .1);
    69   this->setStateDuration(WS_DEACTIVATING, .4);
     68  this->setStateDuration(WS_ACTIVATING, .8);
     69  this->setStateDuration(WS_DEACTIVATING, .8);
    7070
    7171  this->setEnergyMax(10);
     
    9797//     animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
    9898
    99   animation2->addKeyFrame(Vector(1.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    100   animation2->addKeyFrame(Vector(1.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    101   animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     99  animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     100  animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
    102101
    103   animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    104   animation3->addKeyFrame(Vector(1.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    105   animation2->addKeyFrame(Vector(1.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     102  animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.5, ANIM_LINEAR, ANIM_NULL);
     103  animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    106104}
    107105
Note: See TracChangeset for help on using the changeset viewer.