Changeset 6606 in orxonox.OLD for branches/spaceshipcontrol/src/world_entities/weapons/targeting_turret.cc
- Timestamp:
- Jan 18, 2006, 7:32:59 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/spaceshipcontrol/src/world_entities/weapons/targeting_turret.cc
r6439 r6606 92 92 this->target = new Aim(this); 93 93 this->target->setVisibility(false); 94 94 this->lockedTime = 0; 95 this->neededLockTime = 2; 96 this->lockedTarget->setParent(PNode::getNullParent()); 95 97 this->loadModel("models/guns/turret2.obj"); 96 98 … … 119 121 void TargetingTurret::tick(float dt) 120 122 { 123 if( lockedTime >= neededLockTime ) 124 { 125 lockedTarget = this->target->getParent(); 126 lockedTime = 0; 127 } 121 128 122 129 this->target->tick(dt); 130 131 if(this->target->getParent() == PNode::getNullParent()) 132 lockedTime = 0; 133 else 134 lockedTime += dt; 135 123 136 } 124 137 … … 137 150 pj->setAbsDir(this->getAbsDir()); 138 151 pj->activate(); 139 this->target->searchTarget(100 );152 this->target->searchTarget(100,M_PI_2); 140 153 } 141 154
Note: See TracChangeset
for help on using the changeset viewer.