Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10702 in orxonox.OLD


Ignore:
Timestamp:
Jun 14, 2007, 11:23:51 PM (17 years ago)
Author:
nicolasc
Message:

minor improvements, some cleanup

Location:
branches/presentation/src/world_entities/weapons
Files:
3 edited

Legend:

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

    r10698 r10702  
    3838 : Weapon()
    3939{
    40 //     this->registerObject(this, Disruptor::_objectList);
    41 
    4240    this->init();
    4341}
     
    4644 : Weapon()
    4745{
    48 //     this->registerObject(this, Disruptor::_objectList);
    49 
    5046    // TODO add leftRight to params
    5147    this->init();
     
    6864   delete [] this->shootAnim;
    6965   delete [] this->objComp;
    70 /*
    71     for(int j = 0; j < this->getSegs(); j++)
    72     {
    73       delete this->shootAnim[i][j];
    74       delete this->objComp[i][j];
    75     }
    76     delete this->shootAnim[i];
    77     delete this->objComp[i];
    78     delete this->emissionPoint[i];
    79   }*/
    80 
    81 //  this->deconstr();
    82      // model will be deleted from WorldEntity-destructor
     66
    8367}
    8468
     
    198182void Disruptor::draw() const
    199183{
    200   glMatrixMode(GL_MODELVIEW);
    201184  glPushMatrix();
    202   glTranslatef (this->getAbsCoor ().x,
    203                 this->getAbsCoor ().y,
    204                 this->getAbsCoor ().z);
    205     Vector tmpRot = this->getAbsDir().getSpacialAxis();
    206     glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    207 
    208   //Base
    209   static_cast<StaticModel*>(this->getModel())->draw(1);
    210 
    211   // Barrel  glPushMatrix();
    212   glTranslatef
    213     (this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z);
    214     static_cast<StaticModel*>(this->getModel())->draw(0);
     185    glMatrixMode(GL_MODELVIEW);
     186    glTranslatef (this->getAbsCoor ().x,
     187                  this->getAbsCoor ().y,
     188                  this->getAbsCoor ().z);
     189      Vector tmpRot = this->getAbsDir().getSpacialAxis();
     190      glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     191
     192    //Base
     193    static_cast<StaticModel*>(this->getModel())->draw(1);
     194
     195    // Barrel
     196    glPushMatrix();
     197      glTranslatef(this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z);
     198      static_cast<StaticModel*>(this->getModel())->draw(0);
     199    glPopMatrix();
    215200  glPopMatrix();
    216201}
  • branches/presentation/src/world_entities/weapons/nadion_laser.cc

    r10698 r10702  
    8888
    8989  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT);
    90   this->setProjectileTypeC("NadionBlast");   // FIXME temp projectile, until nadion_laser_bolt exists.
     90  this->setProjectileTypeC("NadionBlast");
    9191  this->prepareProjectiles(20);
    9292
     
    167167void NadionLaser::draw() const
    168168{
     169  glPushMatrix();
    169170  glMatrixMode(GL_MODELVIEW);
    170   glPushMatrix();
    171171    glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    172172    Vector tmpRot = this->getAbsDir().getSpacialAxis();
    173173    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    174174    static_cast<StaticModel*>(this->getModel())->draw();
    175 
    176 
    177175  glPopMatrix();
    178176}
  • branches/presentation/src/world_entities/weapons/rf_cannon.cc

    r10701 r10702  
    126126void RFCannon::fire()
    127127{
    128 //   for (int i = 0; i < this->getBarrels(); i++){
    129     Projectile* pj =  this->getProjectile();
    130     if (pj == NULL)
    131       return;
     128  Projectile* pj =  this->getProjectile();
     129  if (pj == NULL)
     130    return;
    132131
    133     // set the owner
    134     pj->setOwner(this->getOwner());
     132  // set the owner
     133  pj->setOwner(this->getOwner());
    135134
    136     pj->setParent(PNode::getNullParent());
     135  pj->setParent(PNode::getNullParent());
    137136
    138     pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*190);
     137  pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*190);
    139138
    140     pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
    141     pj->setAbsDir(this->getAbsDir());
    142     pj->activate();
     139  pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
     140  pj->setAbsDir(this->getAbsDir());
     141  pj->activate();
    143142
    144     this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels();
    145 //   }
     143  this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels();
    146144}
    147145
     
    162160void RFCannon::draw() const
    163161{
    164   glMatrixMode(GL_MODELVIEW);
    165162  glPushMatrix();
     163    glMatrixMode(GL_MODELVIEW);
    166164    glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
    167165    Vector tmpRot = this->getAbsDir().getSpacialAxis();
Note: See TracChangeset for help on using the changeset viewer.