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

    r10747 r10771  
    5555Disruptor::~Disruptor()
    5656{
    57   for (int i = 0; i < this->getBarrels(); i++)
    58   {
    59    delete [] this->shootAnim[i];
    60    delete [] this->objComp[i];
    61   }
    62   delete [] this->emissionPoint;
    63 
    64    delete [] this->shootAnim;
    65    delete [] this->objComp;
    66 
    6757}
    6858
     
    9989  this->setBarrels(1);
    10090  this->setSegs(1);
    101   this->activeBarrel = 0;
    10291
     92  this->setEmissionPoint(Vector(1.672, 0.0, 0.0) * this->getScaling());
    10393
    104 
    105   this->objComp = new PNode**[this->getBarrels()];
    106   this->emissionPoint = new PNode*[this->getBarrels()];
    107   this->shootAnim = new Animation3D**[this->getBarrels()];
    108   for (int i = 0; i < this->getBarrels(); i++)
    109   {
    110     this->objComp[i] = new PNode* [this->getSegs()];
    111     this->emissionPoint[i] = new PNode;
    112     this->emissionPoint[i]->setParent(this);  //Parenting emissionPoint to Weapon
    113     this->emissionPoint[i]->setName("EmissionPoint");
    114     this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
    115     this->shootAnim[i] = new Animation3D* [this->getSegs()];
    116     for(int j = 0; j < this->getSegs(); j++)
    117     {
    118       this->objComp[i][j] = new PNode;
    119       this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);
    120       this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);
    121     }
    122   }
    123 
    124   this->emissionPoint[0]->setRelCoor(Vector(1.672, 0.0, 0.0) * this->getScaling());
    125 
    126 
    127   this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
    128   this->shootAnim[0][0]->addKeyFrame(Vector(-0.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     94  this->getShootAnim(0, 0)->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
     95  this->getShootAnim(0, 0)->addKeyFrame(Vector(-0.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
    12996//   this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
    13097
     
    158125  pj->setVelocity((tmp.getNormalized())*130 + VECTOR_RAND(1));
    159126
    160   pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
     127  pj->setAbsCoor(this->getEmissionPoint());
    161128  pj->setAbsDir(this->getAbsDir());
    162129  pj->activate();
    163130
    164131
    165   this->shootAnim[0][0]->replay();
     132  this->getShootAnim(0, 0)->replay();
    166133}
    167134
     
    196163    // Barrel
    197164    glPushMatrix();
    198       glTranslatef(this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z);
     165      glTranslatef(this->getObjCompx(0,0), this->getObjCompy(0,0), this->getObjCompz(0,0));
    199166      static_cast<StaticModel*>(this->getModel())->draw(0);
    200167    glPopMatrix();
     168
    201169  glPopMatrix();
    202170}
Note: See TracChangeset for help on using the changeset viewer.