Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9755 in orxonox.OLD for branches/new_class_id/src/world_entities


Ignore:
Timestamp:
Sep 17, 2006, 11:33:22 PM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: some minor work… nothing too special, and nothing too big… tried to fix the PNode, and some documentations…

hmm… i also think of writing a book. maybe i will write the whole story as a Commit message :) so it is backed up. hehe

Location:
branches/new_class_id/src/world_entities/weapons
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/world_entities/weapons/targeting_turret.cc

    r9716 r9755  
    3232
    3333TargetingTurret::TargetingTurret(const TiXmlElement* root)
    34   : target(this)
    3534{
    3635  this->init();
     
    4443TargetingTurret::~TargetingTurret ()
    4544{
     45  if(Aim::objectList().exists(target))
     46    delete target;
    4647  // model will be deleted from WorldEntity-destructor
    4748//  delete this->target;
     
    5152{
    5253  this->registerObject(this, TargetingTurret::_objectList);
     54  this->target = new Aim(this);
    5355
    5456  Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);
     
    7880  //this->getProjectileFactory()->prepare(100);
    7981
    80   this->target.setVisibility(false);
    81   this->target.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
    82   this->target.setRange(1000);
    83   this->target.setAngle(M_PI_4);
    84   this->lockedTarget = &this->target;
     82  this->target->setVisibility(false);
     83  this->target->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | PNODE_PROHIBIT_CHILD_DELETE);
     84  this->target->setRange(1000);
     85  this->target->setAngle(M_PI_4);
     86  this->lockedTarget = this->target;
    8587
    8688  this->lockedTime = 0;
     
    99101  Weapon::loadParams(root);
    100102
    101   LoadParam(root, "target-group", &target, Aim, setTargetGroupS);
     103  LoadParam(root, "target-group", target, Aim, setTargetGroupS);
    102104
    103105}
     
    111113void TargetingTurret::deactivate()
    112114{
    113   this->target.setVisibility(false);
     115  this->target->setVisibility(false);
    114116}
    115117
     
    119121    return;
    120122
    121   this->target.tick(dt);
     123  this->target->tick(dt);
    122124
    123125  if( lockedTime >= neededLockTime )
    124126   {
    125     lockedTarget = this->target.getParent();
     127    lockedTarget = this->target->getParent();
    126128    lockedTime = 0;
    127129   }
    128130
    129131
    130   if(this->target.getParent() == PNode::getNullParent())
     132  if(this->target->getParent() == PNode::getNullParent())
    131133   lockedTime = 0;
    132134  else
  • branches/new_class_id/src/world_entities/weapons/targeting_turret.h

    r9715 r9755  
    2727  virtual void draw() const;
    2828
    29   void setTargetGroup(OM_LIST targetGroup) { this->target.setTargetGroup(targetGroup); };
     29  void setTargetGroup(OM_LIST targetGroup) { this->target->setTargetGroup(targetGroup); };
    3030  const PNode* getLockedTarget() const { return lockedTarget; };
    3131
     
    3434
    3535private:
    36   Aim            target;
     36  Aim*           target;
    3737  PNode*         lockedTarget;
    3838  float          lockedTime;
  • branches/new_class_id/src/world_entities/weapons/weapon_manager.cc

    r9727 r9755  
    5757  // crosshair being a PNode it must not be deleted (this is because PNodes delete themselves.)
    5858  // rennerc: crosshair seems not to delete itselve
    59   if (Crosshair::objectList().exists(this->crosshair))
    60     delete this->crosshair;
     59  //if (Crosshair::objectList().exists(this->crosshair))
     60  //  delete this->crosshair;
    6161}
    6262
Note: See TracChangeset for help on using the changeset viewer.