Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10698 in orxonox.OLD for trunk/src/world_entities/weapons/weapon.cc


Ignore:
Timestamp:
Jun 14, 2007, 5:33:43 PM (17 years ago)
Author:
snellen
Message:

merged adm, hud, vs-enhancements : beni's responsible for this commit. blame him!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/weapons/weapon.cc

    r10529 r10698  
    134134  for(int i = 0; i < this->barrels; i++){
    135135    this->emissionPoint[i] = new PNode;
    136     this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
     136    this->emissionPoint[i]->setParent(this);  //Parenting emissionPoint to Weapons
    137137    this->emissionPoint[i]->setName("EmissionPoint");
    138138    this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
     
    158158  // set this object to be synchronized over network
    159159  //this->setSynchronized(true);
    160 }
    161 
    162 /**
    163  * needed, if there are more than one barrel or segments
    164  */
    165 void Weapon::init2()
    166 {
    167   if (this->barrels == 1 && this->segs == 1)
    168     return;
    169 
    170   delete this->emissionPoint[0];
    171   delete this->emissionPoint;
    172   delete this->shootAnim[0];
    173   delete this->shootAnim;
    174 
    175   this->shootAnim = new Animation3D**[this->barrels];
    176   this->emissionPoint = new PNode*[this->barrels];
    177   for(int i = 0; i < this->barrels; i++){
    178     this->emissionPoint[i] = new PNode;
    179     this->emissionPoint[i]->setParent(this);             //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles
    180     this->emissionPoint[i]->setName("EmissionPoint");
    181     this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
    182     this->shootAnim[i] = new Animation3D* [this->segs];
    183   }
    184 }
    185 
    186 /**
    187  * deconstructor for init2
    188  */
    189 void Weapon::deconstr()
    190 {
    191   for(int i = 0; i < this->barrels; i++) {
    192     delete this->emissionPoint[i];
    193     for (int j = 0; j < this->segs; j++)
    194       delete this->shootAnim[i][j];
    195     delete this->shootAnim[i];
    196   }
    197 
    198   delete this->emissionPoint;
    199   delete this->shootAnim;
    200160}
    201161
Note: See TracChangeset for help on using the changeset viewer.