Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5001 in orxonox.OLD for orxonox/trunk/src/world_entities


Ignore:
Timestamp:
Aug 13, 2005, 10:08:47 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: update-setRelDir works correctly now :)

File:
1 edited

Legend:

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

    r5000 r5001  
    116116void Turret::tick(float dt)
    117117{
     118  Quaternion quat;
    118119  Vector direction = this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();
     120
    119121  direction.normalize();
     122
    120123  if (likely (this->getParent() != NULL))
    121   {
    122     Quaternion quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
    123     this->setAbsDir(quat);
    124   }
     124    quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
    125125  else
    126   {
    127     Quaternion quat = Quaternion(direction, this->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
    128     this->setAbsDir(quat);
    129   }
     126    quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
     127
     128  this->setAbsDir(quat);
    130129}
    131130
Note: See TracChangeset for help on using the changeset viewer.