Changeset 9755 in orxonox.OLD for branches/new_class_id/src/world_entities
- Timestamp:
- Sep 17, 2006, 11:33:22 PM (18 years ago)
- 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 32 32 33 33 TargetingTurret::TargetingTurret(const TiXmlElement* root) 34 : target(this)35 34 { 36 35 this->init(); … … 44 43 TargetingTurret::~TargetingTurret () 45 44 { 45 if(Aim::objectList().exists(target)) 46 delete target; 46 47 // model will be deleted from WorldEntity-destructor 47 48 // delete this->target; … … 51 52 { 52 53 this->registerObject(this, TargetingTurret::_objectList); 54 this->target = new Aim(this); 53 55 54 56 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this); … … 78 80 //this->getProjectileFactory()->prepare(100); 79 81 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; 85 87 86 88 this->lockedTime = 0; … … 99 101 Weapon::loadParams(root); 100 102 101 LoadParam(root, "target-group", &target, Aim, setTargetGroupS);103 LoadParam(root, "target-group", target, Aim, setTargetGroupS); 102 104 103 105 } … … 111 113 void TargetingTurret::deactivate() 112 114 { 113 this->target .setVisibility(false);115 this->target->setVisibility(false); 114 116 } 115 117 … … 119 121 return; 120 122 121 this->target .tick(dt);123 this->target->tick(dt); 122 124 123 125 if( lockedTime >= neededLockTime ) 124 126 { 125 lockedTarget = this->target .getParent();127 lockedTarget = this->target->getParent(); 126 128 lockedTime = 0; 127 129 } 128 130 129 131 130 if(this->target .getParent() == PNode::getNullParent())132 if(this->target->getParent() == PNode::getNullParent()) 131 133 lockedTime = 0; 132 134 else -
branches/new_class_id/src/world_entities/weapons/targeting_turret.h
r9715 r9755 27 27 virtual void draw() const; 28 28 29 void setTargetGroup(OM_LIST targetGroup) { this->target .setTargetGroup(targetGroup); };29 void setTargetGroup(OM_LIST targetGroup) { this->target->setTargetGroup(targetGroup); }; 30 30 const PNode* getLockedTarget() const { return lockedTarget; }; 31 31 … … 34 34 35 35 private: 36 Aim 36 Aim* target; 37 37 PNode* lockedTarget; 38 38 float lockedTime; -
branches/new_class_id/src/world_entities/weapons/weapon_manager.cc
r9727 r9755 57 57 // crosshair being a PNode it must not be deleted (this is because PNodes delete themselves.) 58 58 // 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; 61 61 } 62 62
Note: See TracChangeset
for help on using the changeset viewer.