Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Nov 24, 2005, 12:13:22 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the WorldEntities into the Trunk.
Merged with command:
svn merge branches/world_entities/ trunk/ -r5516:HEAD

conflics from world_entities changed in favor of branches/world_entity
all other conflict in favor of the trunk

File:
1 edited

Legend:

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

    r5512 r5750  
    3030#include "factory.h"
    3131
    32 CREATE_FACTORY(Turret);
     32CREATE_FACTORY(Turret, CL_TURRET);
    3333
    3434using namespace std;
    3535
    36 
    3736/**
    3837 *  standard constructor
    39 
    40    creates a new weapon
    41 */
    42 Turret::Turret (WeaponManager* weaponManager)
    43   : Weapon(weaponManager)
     38 *
     39 * creates a new Turret
     40 */
     41Turret::Turret ()
     42  : Weapon()
    4443{
    4544  this->init();
     
    5352}
    5453
    55 
     54/**
     55 * creates a new Turret from a TiXmlElement
     56 */
    5657Turret::Turret(const TiXmlElement* root)
    5758{
     
    117118{
    118119  Quaternion quat;
    119   Vector direction = this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();
     120  Vector direction = this->getAbsCoor();/*this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();*/
    120121
    121122  direction.normalize();
     
    135136    return;
    136137
    137   PNode* target = this->getWeaponManager()->getFixedTarget();
    138 
    139   if (target != NULL)
    140   {
    141138    pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(13)
    142139            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
    143   }
    144   else
    145     pj->setVelocity(target->getVelocity());
    146140
    147141  pj->setParent(NullParent::getInstance());
     
    159153void Turret::draw () const
    160154{
    161   this->getWeaponManager()->getFixedTarget()->debugDraw(10);
    162 
    163155  /* draw gun body */
    164156  glMatrixMode(GL_MODELVIEW);
Note: See TracChangeset for help on using the changeset viewer.