Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10217 in orxonox.OLD for branches/playability/src/world_entities


Ignore:
Timestamp:
Jan 10, 2007, 3:37:40 PM (18 years ago)
Author:
nicolasc
Message:

bump

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

Legend:

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

    r10196 r10217  
    7474  this->weaponMan->changeWeaponConfig(0);
    7575
    76 
     76  this->ttd = false;
    7777}
    7878
     
    177177
    178178  if (this->tickLifeCycle(dt)){
    179     this->weaponMan->fire();
    180     this->deactivate();
     179    this->weaponMan->getWeapon(0)->requestAction(WA_SHOOT);
     180    if (this->ttd)
     181      this->deactivate();
     182    this->ttd = true;
    181183  }
    182184
  • branches/playability/src/world_entities/projectiles/spike_ball.h

    r10196 r10217  
    6565    WeaponManager*                   weaponMan;
    6666
     67    bool                             ttd;
    6768};
    6869
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10196 r10217  
    202202 
    203203  this->weaponMan.changeWeaponConfig(3);
    204   this->secWeaponMan.changeWeaponConfig(0);
     204  this->secWeaponMan.changeWeaponConfig(1);
    205205
    206206  curWeaponPrimary    = 3;
  • branches/playability/src/world_entities/weapons/spike_launcher.cc

    r10196 r10217  
    108108  this->launcher = new Vector [this->spikes];
    109109
     110  this->getProjectileFactory()->prepare(this->spikes);  //we don't need more...
     111
     112//   this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
     113//   this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
     114//   this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
     115
     116}
     117
     118void SpikeLauncher::loadParams(const TiXmlElement* root)
     119{
     120  Weapon::loadParams(root);
     121}
     122
     123void SpikeLauncher::activate()
     124{
    110125  this->launcher[0] = Vector(1.0, 0.0, 0.0);
    111126  this->launcher[1] = Vector(0.0, 1.0, 0.0);
     
    130145    this->launcher[tmp + i] =  this->launcher[i] * (-1);
    131146  }
    132 
    133   this->getProjectileFactory()->prepare(this->spikes);  //we don't need more...
    134 
    135 //   this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
    136 //   this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
    137 //   this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
    138 
    139 }
    140 
    141 void SpikeLauncher::loadParams(const TiXmlElement* root)
    142 {
    143   Weapon::loadParams(root);
    144 }
    145 
    146 void SpikeLauncher::activate()
    147 {
    148147}
    149148
     
    196195  ca = cos (this->getParent()->getAngle());
    197196  sa = sin (this->getParent()->getAngle());*/
     197/*
     198  float * m = new float [9];
     199  m[0] = 1.0f+(1.0f-ca)*(nx*nx-1.0f);
     200  m[1] = -nz*sa+(1.0f-ca)*nx*ny;
     201  m[2] = ny*sa+(1.0f-ca)*nx*nz;
     202  m[3] = nz*sa+(1.0f-ca)*nx*ny;
     203  m[4] = 1.0f+(1.0f-ca)*(ny*ny-1.0f);
     204  m[5] = -nx*sa+(1.0f-ca)*ny*nz;
     205  m[6] = -ny*sa+(1.0f-ca)*nx*nz;
     206  m[7] = nx*sa+(1.0f-ca)*ny*nz;
     207  m[8] = 1.0f+(1.0f-ca)*(nz*nz-1.0f);*/
    198208
    199209  m[0][0] = nx * nx * (1 - ca) + ca;
     
    209219  float x, y, z;
    210220  for (int i = 0; i < this->spikes;i++){
     221
    211222    x = m[0][0] * this->launcher[i].x + m[0][1] * this->launcher[i].y + m[0][2] * this->launcher[i].z;
    212223    y = m[1][0] * this->launcher[i].x + m[1][1] * this->launcher[i].y + m[1][2] * this->launcher[i].z;
    213224    z = m[2][0] * this->launcher[i].x + m[2][1] * this->launcher[i].y + m[2][2] * this->launcher[i].z;
    214 
     225/*
     226    x = this->launcher[i].x * m[0] + this->launcher[i].y * m[1] + this->launcher[i].z * m[2];
     227    y = this->launcher[i].x * m[3] + this->launcher[i].y * m[4] + this->launcher[i].z * m[5];
     228    z = this->launcher[i].x * m[6] + this->launcher[i].y * m[7] + this->launcher[i].z * m[8];*/
    215229    this->launcher[i] = Vector (x, y, z);
    216230  }
     
    224238void SpikeLauncher::fire()
    225239{
    226   // temporary solution to test module
     240  // temporary solution to test the module
    227241  updateFireDir(VECTOR_RAND(1), 20);
    228242
    229 
     243  printf("fireing spikes\n");
    230244  Projectile* pj = NULL;
    231245  for (int i = 0; i < this->spikes; i++)
     
    240254    pj->setParent(PNode::getNullParent());
    241255    pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size);
    242     pj->setRelDir(0, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z);
     256//     Quaternion q;
     257//     pj->setRelDir(q.lookAt(Vector(), this->launcher[i], VECTOR_RAND(1)));
     258    pj->setRelDir(90, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z);
    243259
    244260    pj->toList(this->getOMListNumber());
  • branches/playability/src/world_entities/weapons/spike_launcher.h

    r10188 r10217  
    2828    virtual void fire();
    2929
    30     virtual void updateFireDir(Vector v, float angle);
     30    virtual void updateFireDir(Vector t, float angle);
    3131
    3232  private:
Note: See TracChangeset for help on using the changeset viewer.