Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 27, 2007, 7:01:08 PM (17 years ago)
Author:
nicolasc
Message:

huge diff
cleaned the individual weapons, moved stuff to weapon.{cc,h}
and some minor fixes which popped up then and when

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/weapons/rf_cannon.cc

    r10728 r10771  
    5555RFCannon::~RFCannon()
    5656{
    57   for (int i = 0; i < this->getBarrels(); i++)
    58     delete [] this->objComp[i];
    59 
    60   delete [] this->emissionPoint;
    61   delete [] this->objComp;
    6257}
    6358
     
    9186  this->setBarrels(4);
    9287  this->setSegs(1);
    93   this->activeBarrel = (rand() % 4);
     88  this->setActiveBarrel(rand() % 4);
    9489
    95   this->objComp = new PNode**[this->getBarrels()];
    96   this->emissionPoint = new PNode*[this->getBarrels()];
    97   for (int i = 0; i < this->getBarrels(); i++) {
    98     this->objComp[i] = new PNode* [this->getSegs()];
    99     this->emissionPoint[i] = new PNode;
    100     this->emissionPoint[i]->setParent(this);
    101     this->emissionPoint[i]->setName("EmissionPoint");
    102     this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
    103     for(int j = 0; j < this->getSegs(); j++) {
    104       this->objComp[i][j] = new PNode;
    105     }
    106   }
    10790
    108   this->emissionPoint[0]->setRelCoor(Vector(4.1, 0.0, 0.75) * this->getScaling());
    109   this->emissionPoint[1]->setRelCoor(Vector(4.1, 0.45, 0.0) * this->getScaling());
    110   this->emissionPoint[2]->setRelCoor(Vector(4.1, 0.0, -0.75) * this->getScaling());
    111   this->emissionPoint[3]->setRelCoor(Vector(4.1, -0.45, 0.0) * this->getScaling());
     91  this->setEmissionPoint(Vector(4.1, 0.0, 0.75) * this->getScaling(), 0);
     92  this->setEmissionPoint(Vector(4.1, 0.45, 0.0) * this->getScaling(), 1);
     93  this->setEmissionPoint(Vector(4.1, 0.0, -0.75) * this->getScaling(), 2);
     94  this->setEmissionPoint(Vector(4.1, -0.45, 0.0) * this->getScaling(), 3);
    11295
    11396  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
     
    140123  pj->setVelocity(this->getParent()->getVelocity() + (tmp.getNormalized())*190);
    141124
    142   pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
     125  pj->setAbsCoor(this->getEmissionPoint());
     126  //FIXME pj needs a absDir
    143127//   pj->setAbsDir(this->getAbsDir());
    144128//   pj->setAbsDir(Quaternion(tmp.getNormalized(), this->getParent()->getAbsDir().apply(Vector(0,1,0))));
     
    146130  pj->activate();
    147131
    148   this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels();
     132  this->cycleBarrel();
    149133}
    150134
Note: See TracChangeset for help on using the changeset viewer.