Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5819 in orxonox.OLD for trunk/src/world_entities/weapons/turret.cc


Ignore:
Timestamp:
Nov 29, 2005, 11:07:43 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: merged branches world_entities to trunk again
merged with command
svn merge -r5795:HEAD branches/world_entities/ trunk/
no conflicts (what a wonder)

File:
1 edited

Legend:

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

    r5766 r5819  
    4444  this->init();
    4545
    46   this->loadModel("models/guns/turret1.obj");
    47 
    48 
    4946  this->setActionSound(WA_SHOOT, "sound/shot1.wav");
    5047  this->setActionSound(WA_ACTIVATE, "sound/vocals/missiles.wav");
    5148  this->setActionSound(WA_RELOAD, "sound/vocals/reload.wav");
     49
     50  this->loadModel("models/guns/turret1.obj");
    5251}
    5352
     
    7271{
    7372  this->setClassID(CL_TURRET, "Turret");
     73
    7474
    7575  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
     
    136136    return;
    137137
    138     pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(13)
     138  pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 /*+ VECTOR_RAND(13) */
    139139            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
    140  
     140
    141141
    142142  pj->setParent(NullParent::getInstance());
     
    154154void Turret::draw () const
    155155{
    156   /* draw gun body */
    157   glMatrixMode(GL_MODELVIEW);
    158   glPushMatrix();
    159   glTranslatef (this->getAbsCoor ().x,
    160                 this->getAbsCoor ().y,
    161                 this->getAbsCoor ().z);
    162   Vector tmpRot = this->getAbsDir().getSpacialAxis();
    163   glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
     156  if (this->model != NULL)
     157  {
     158    /* draw gun body */
     159    glMatrixMode(GL_MODELVIEW);
     160    glPushMatrix();
     161    glTranslatef (this->getAbsCoor ().x,
     162                  this->getAbsCoor ().y,
     163                  this->getAbsCoor ().z);
     164    Vector tmpRot = this->getAbsDir().getSpacialAxis();
     165    glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z );
    164166
    165   this->model->draw();
    166   glPopMatrix();
     167    this->model->draw();
     168    glPopMatrix();
     169  }
    167170}
    168 
Note: See TracChangeset for help on using the changeset viewer.