Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4966 in orxonox.OLD for orxonox/trunk/src/world_entities/weapons


Ignore:
Timestamp:
Jul 28, 2005, 5:53:15 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: Turret is fixed onto the ship as it should.
TestGun fires staight again
PNode now know getParent(), as this is a quite usefull function
Vector still has an error in the getNormalized function, and i am not able to determine the cause of this

Location:
orxonox/trunk/src/world_entities/weapons
Files:
2 edited

Legend:

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

    r4959 r4966  
    160160  Projectile* pj =  dynamic_cast<Projectile*>(this->getProjectileFactory()->resurrect());
    161161
     162/*
    162163  PNode* target = this->getWeaponManager()->getFixedTarget();
    163 
    164164  if (target != NULL)
    165165  {
    166166    pj->setVelocity(this->getVelocity()+(target->getAbsCoor() - this->getAbsCoor())*.5);//this->getVelocity());
    167167  }
    168   else
    169     pj->setVelocity(target->getVelocity());
    170 
     168  else*/
     169  pj->setVelocity(this->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*20);
    171170
    172171  pj->setAbsCoor(this->getEmissionPoint());
  • orxonox/trunk/src/world_entities/weapons/turret.cc

    r4965 r4966  
    9393  Vector direction = this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();
    9494  direction.normalize();
    95   Quaternion quat = Quaternion(direction, Vector(0,1,0)) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
     95  Quaternion quat = Quaternion(direction, this->getParent()->getAbsDir().apply(Vector(0,1,0))) * Quaternion ( -M_PI_2, Vector(0,1,0)) ;
    9696
    9797  this->setAbsDir(quat);
Note: See TracChangeset for help on using the changeset viewer.