Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 23, 2005, 9:41:24 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: removed WeaponManager from all the Weapons, because weapon should not know where it is connected to

File:
1 edited

Legend:

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

    r5622 r5745  
    4040   creates a new weapon
    4141*/
    42 Turret::Turret (WeaponManager* weaponManager)
    43   : Weapon(weaponManager)
     42Turret::Turret ()
     43  : Weapon()
    4444{
    4545  this->init();
     
    117117{
    118118  Quaternion quat;
    119   Vector direction = this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();
     119  Vector direction = this->getAbsCoor();/*this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();*/
    120120
    121121  direction.normalize();
     
    135135    return;
    136136
    137   PNode* target = this->getWeaponManager()->getFixedTarget();
    138 
    139   if (target != NULL)
    140   {
    141137    pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(13)
    142138            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
    143   }
    144   else
    145     pj->setVelocity(target->getVelocity());
    146139
    147140  pj->setParent(NullParent::getInstance());
     
    159152void Turret::draw () const
    160153{
    161   this->getWeaponManager()->getFixedTarget()->debugDraw(10);
    162 
    163154  /* draw gun body */
    164155  glMatrixMode(GL_MODELVIEW);
Note: See TracChangeset for help on using the changeset viewer.