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/light_blaster.cc

    r10698 r10771  
    5353{
    5454
    55   for (int i = 0; i < this->getBarrels(); i++)
    56   {
    57    //delete [] this->shootAnim[i];
    58    delete [] this->objComp[i];
    59   }
    60   delete [] this->emissionPoint;
    61    //delete [] this->shootAnim;
    62    delete [] this->objComp;
    63 
    6455}
    6556
     
    9384
    9485  this->setBarrels(3);
    95   this->setSegs(1);
    96   this->activeBarrel = 0;
     86  this->setSegs(1); //could be left out
    9787
    98   this->objComp = new PNode**[this->getBarrels()];
    99   this->emissionPoint = new PNode*[this->getBarrels()];
    100 //   this->shootAnim = new Animation3D**[this->getBarrels()];
    101   for (int i = 0; i < this->getBarrels(); i++)
    102   {
    103     this->objComp[i] = new PNode* [this->getSegs()];
    104     this->emissionPoint[i] = new PNode;
    105     this->emissionPoint[i]->setParent(this);
    106     this->emissionPoint[i]->setName("EmissionPoint");
    107     this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
    108     for(int j = 0; j < this->getSegs(); j++)
    109     {
    110       this->objComp[i][j] = new PNode;
    111 //       this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);
    112 //       this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);
    113     }
    114   }
    115 
    116   this->emissionPoint[0]->setRelCoor(Vector(2.2, 0.0, 0.1));
    117   this->emissionPoint[1]->setRelCoor(Vector(2.2, -0.07, -0.05));
    118   this->emissionPoint[2]->setRelCoor(Vector(2.2, 0.07, -0.05));
     88  this->setEmissionPoint(Vector(2.2, 0.0, 0.1), 0);
     89  this->setEmissionPoint(Vector(2.2, -0.07, -0.05), 1);
     90  this->setEmissionPoint(Vector(2.2, 0.07, -0.05), 2);
    11991
    12092//   Animation3D* animation1 = this->getAnimation(WS_SHOOTING, this);
     
    148120  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*180);
    149121
    150   pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
     122  pj->setAbsCoor(this->getEmissionPoint());
    151123  pj->setAbsDir(this->getAbsDir());
    152124//   pj->toList(OM_GROUP_01_PROJ);
    153125  pj->activate();
    154126
    155 //   for (int i = 0; i < this->getSegs(); i++)
    156 //     this->shootAnim[this->activeBarrel][i]->replay();
    157 
    158   // switch barrel
    159   this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels();
     127  this->cycleBarrel();
    160128}
    161129
Note: See TracChangeset for help on using the changeset viewer.