Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 8, 2007, 9:46:13 PM (17 years ago)
Author:
nicolasc
Message:

just another upload
GUI seems to work, but there are still some unexplainable segfaults

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/weapons/spike_launcher.cc

    r10188 r10196  
    102102  this->size = 2.5;
    103103
     104  this->setEmissionPoint(0.0, 0.0, 0.0);
     105
     106
    104107  this->spikes = 26;
    105108  this->launcher = new Vector [this->spikes];
     
    128131  }
    129132
    130 //   this->setEmissionPoint(1.684, 0.472, 0);
    131133  this->getProjectileFactory()->prepare(this->spikes);  //we don't need more...
    132134
    133   this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav");
    134   this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
    135   this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
     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");
    136138
    137139}
     
    179181
    180182  float nx, ny, nz, ca, sa;
     183
    181184  nx = v.x;
    182185  ny = v.y;
     
    187190// final version below... easier to to cheat with the one above.
    188191/*
    189   nx = this->getParent()->getRotationVector().x
    190   ny = this->getParent()->getRotationVector().y
    191   nz = this->getParent()->getRotationVector().z
     192  nx = this->getParent()->getRotationVector().x;
     193  ny = this->getParent()->getRotationVector().y;
     194  nz = this->getParent()->getRotationVector().z;
    192195
    193196  ca = cos (this->getParent()->getAngle());
     
    212215    this->launcher[i] = Vector (x, y, z);
    213216  }
     217
     218  for( int i = 0; i < 3 ; i++)
     219    delete m[i];
     220  delete m;
    214221}
    215222
     
    222229
    223230  Projectile* pj = NULL;
    224 //   for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
    225231  for (int i = 0; i < this->spikes; i++)
    226232  {
     
    230236
    231237//     pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10)));
    232     pj->setVelocity(this->launcher[i] * 200.0);
     238    pj->setVelocity(this->launcher[i] * 300.0);
    233239
    234240    pj->setParent(PNode::getNullParent());
    235241    pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size);
    236     pj->setAbsDir(Quaternion(this->launcher[i], 0));
     242    pj->setRelDir(0, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z);
     243
     244    pj->toList(this->getOMListNumber());
    237245    pj->activate();
    238246  }
Note: See TracChangeset for help on using the changeset viewer.