Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 4, 2006, 11:01:28 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy bache back with no conflicts

File:
1 edited

Legend:

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

    r9406 r9656  
    1717#include "targeting_turret.h"
    1818
    19 #include "weapon_manager.h"
    20 #include "aim.h"
    21 #include "world_entities/projectiles/projectile.h"
     19#include "projectiles/projectile.h"
    2220
    2321#include "model.h"
     
    2523#include "animation3d.h"
    2624
     25#include "util/loading/load_param.h"
    2726#include "util/loading/factory.h"
    2827
     
    3029
    3130
    32 
    33 
    34 /**
    35  *  standard constructor
    36 
    37    creates a new weapon
    38 */
    39 TargetingTurret::TargetingTurret ()
    40   : Weapon()
    41 {
    42   this->init();
    43 
    44 }
    45 
    46 
    4731TargetingTurret::TargetingTurret(const TiXmlElement* root)
     32  : target(this)
    4833{
    4934  this->init();
     
    9176  //this->getProjectileFactory()->prepare(100);
    9277
    93   this->target = new Aim(this);
    94   this->target->setVisibility(false);
    95   this->target->setRange(1000);
    96   this->target->setAngle(M_PI_4);
    97   this->lockedTarget = this->target;
     78  this->target.setVisibility(false);
     79  this->target.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
     80  this->target.setRange(1000);
     81  this->target.setAngle(M_PI_4);
     82  this->lockedTarget = &this->target;
    9883
    9984  this->lockedTime = 0;
     
    11297  Weapon::loadParams(root);
    11398
     99  LoadParam(root, "target-group", &target, Aim, setTargetGroupS);
     100
    114101}
    115102
     
    122109void TargetingTurret::deactivate()
    123110{
    124   this->target->setVisibility(false);
     111  this->target.setVisibility(false);
    125112}
    126113
     
    130117    return;
    131118
     119  this->target.tick(dt);
     120
    132121  if( lockedTime >= neededLockTime )
    133122   {
    134     lockedTarget = this->target->getParent();
     123    lockedTarget = this->target.getParent();
    135124    lockedTime = 0;
    136125   }
    137126
    138   this->target->tick(dt);
    139127
    140   if(this->target->getParent() == PNode::getNullParent())
     128  if(this->target.getParent() == PNode::getNullParent())
    141129   lockedTime = 0;
    142130  else
     
    159147  pj->setAbsDir(this->getAbsDir());
    160148  pj->activate();
    161 
    162149}
    163150
Note: See TracChangeset for help on using the changeset viewer.