Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 27, 2005, 7:10:01 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: ground-turret loadability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/world_entities/src/world_entities/weapons/ground_turret.cc

    r5797 r5801  
    8181   * @todo: make the class Loadable
    8282   */
    83 //  LoadParamXML(root, "Weapons", this, GroundTurret, loadWeapon);
     83  const TiXmlElement* element;
     84
     85  element = root->FirstChildElement("weapon-left");
     86  if (element != NULL) element = element->FirstChildElement();
     87  this->left = dynamic_cast<Weapon*>( Factory::getFirst()->fabricate( element) );
     88  if (this->left)
     89  {
     90    this->left->setParent(this);
     91    this->left->setRelCoor(0,10,-5);
     92  }
     93
     94  element = root->FirstChildElement("weapon-right");
     95  if (element != NULL)  if (element != NULL) element = element->FirstChildElement();
     96  this->right = dynamic_cast<Weapon*>( Factory::getFirst()->fabricate( element) );
     97  if (this->right)
     98  {
     99    this->right->setParent(this);
     100    this->right->setRelCoor(0,10,5);
     101  }
    84102}
    85 
    86103
    87104/**
     
    113130  if (this->model)
    114131    this->model->draw();
    115   if (left != NULL)
     132
     133  glPopMatrix();
     134  if (this->left != NULL)
    116135    this->left->draw();
    117136  if (this->right != NULL)
    118137    this->right->draw();
    119 
    120   glPopMatrix();
    121138}
    122139
Note: See TracChangeset for help on using the changeset viewer.