Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10037 in orxonox.OLD for branches/playability/src


Ignore:
Timestamp:
Dec 10, 2006, 1:51:44 PM (18 years ago)
Author:
nicolasc
Message:

added some comments
made swarm missile spin

Location:
branches/playability/src/world_entities
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/projectiles/swarm_projectile.cc

    r10035 r10037  
    3838
    3939/*  this->loadModel("models/projectiles/orx-rocket.obj", 0.5);*/
    40   this->loadModel("models/projectiles/swarm_projectile.obj");
     40  this->loadModel("models/projectiles/swarm_projectile.obj"); // no double rescale (see draw())
    4141  this->loadExplosionSound("sound/explosions/explosion_4.wav");
    4242
     
    5151  this->emitter->setParent(this);
    5252  this->emitter->setSpread(M_PI, M_PI);
     53
     54  this->rotationSpeed = 100;
     55  this->angle = 0;
    5356}
    5457
     
    214217    velocity *= maxVelocity / velocity.len(); // set speed to max
    215218
     219
    216220  this->shiftCoor(velocity * time);
    217221
    218222  if(this->tickLifeCycle(time))
    219223    this->deactivate();
     224
     225  this->updateAngle(time);
    220226}
    221227
     
    239245}
    240246
     247void SwarmProjectile::updateAngle(float time)
     248{
     249  this->angle += this->rotationSpeed * time;
     250}
    241251
    242252void SwarmProjectile::draw () const
     
    247257  float matrix[4][4];
    248258  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
     259  glRotatef(this->angle, 1.0f, 0.0f, 0.0f); //spinning missile
    249260  this->getAbsDir().matrix (matrix);
    250261  glMultMatrixf((float*)matrix);
    251   //glScalef(2.0, 2.0, 2.0);
     262  //glScalef(2.0, 2.0, 2.0);  // no double rescale
    252263  this->getModel()->draw();
    253264
  • branches/playability/src/world_entities/projectiles/swarm_projectile.h

    r10035 r10037  
    5151    Vector newDirection(Vector curDirection, Vector estTargetDir, float angle);
    5252
     53    // spinning missle
     54    void updateAngle(float time);
     55    float                             rotationSpeed;
     56    float                             angle;
    5357};
    5458
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10036 r10037  
    511511    bFire = bSecFire = false;
    512512
     513  // fire reqeust/release for primary weapons
    513514  if( this->bFire)
    514515    this->weaponMan.fire();
     
    516517    this->weaponMan.releaseFire();
    517518
     519  // fire reqeust/release for secondary weapons
    518520  if( this->bSecFire)
    519521    this->secWeaponMan.fire();
  • branches/playability/src/world_entities/weapons/swarm_launcher.cc

    r10023 r10037  
    9191
    9292  this->setEmissionPoint(1.684, 0.472, 0);
    93   //this->getProjectileFactory()->prepare(100);
     93  this->getProjectileFactory()->prepare(5);
    9494
    95   this->setActionSound(WA_SHOOT, "sound/explosions/explosion_3.wav");
     95  this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
    9696  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
    9797  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
  • branches/playability/src/world_entities/weapons/weapon.cc

    r10036 r10037  
    352352  if (likely(this->isActive()))
    353353  {
     354    /** Disabled for releaseFire() from WM*/
    354355    //if (this->requestedAction != WA_NONE)
    355356    //  return;
Note: See TracChangeset for help on using the changeset viewer.