Changeset 5955 in orxonox.OLD for branches/powerups/src/world_entities/weapons
- Timestamp:
- Dec 7, 2005, 1:05:10 PM (19 years ago)
- Location:
- branches/powerups/src/world_entities/weapons
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/powerups/src/world_entities/weapons/aiming_turret.cc
r5819 r5955 26 26 27 27 #include "animation3d.h" 28 #include "sound_engine.h"29 28 30 29 #include "factory.h" … … 93 92 94 93 this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET); 95 this->setProjectileType(CL_ ROCKET);94 this->setProjectileType(CL_GUIDED_MISSILE); 96 95 97 96 … … 142 141 return; 143 142 144 143 pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDir().apply(Vector(1,0,0))*250.0 + VECTOR_RAND(13) 145 144 /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 146 145 146 pj->setTarget(this->target->getParent()); 147 147 pj->setParent(NullParent::getInstance()); 148 148 pj->setAbsCoor(this->getEmissionPoint()); -
branches/powerups/src/world_entities/weapons/cannon.cc
r5828 r5955 32 32 #include "list.h" 33 33 #include "animation3d.h" 34 #include "sound_engine.h"35 34 36 35 #include "null_parent.h" -
branches/powerups/src/world_entities/weapons/ground_turret.cc
r5819 r5955 145 145 void GroundTurret::collidesWith (WorldEntity* entity, const Vector& location) 146 146 { 147 147 if (entity->isA(CL_PROJECTILE)) 148 this->setAbsDirSoft(Quaternion(-90, Vector(0,0,1)), 90); 148 149 } 149 150 -
branches/powerups/src/world_entities/weapons/guided_missile.cc
r5779 r5955 48 48 this->energyMin = 1; 49 49 this->energyMax = 10; 50 this->lifeSpan = 5 ;51 this->agility = 5 ;50 this->lifeSpan = 5.0; 51 this->agility = 5.0; 52 52 this->maxVelocity = 100; 53 53 -
branches/powerups/src/world_entities/weapons/test_gun.cc
r5819 r5955 32 32 #include "list.h" 33 33 #include "animation3d.h" 34 #include "sound_engine.h"35 34 36 35 #include "null_parent.h" -
branches/powerups/src/world_entities/weapons/turret.cc
r5819 r5955 26 26 #include "list.h" 27 27 #include "animation3d.h" 28 #include "sound_engine.h"29 28 30 29 #include "factory.h" -
branches/powerups/src/world_entities/weapons/weapon.cc
r5750 r5955 28 28 #include "load_param.h" 29 29 #include "state.h" 30 #include "sound_engine.h"31 30 #include "animation3d.h" 32 31 #include "vector.h" 32 33 #include "sound_source.h" 34 #include "sound_buffer.h" 33 35 34 36 //////////////////// -
branches/powerups/src/world_entities/weapons/weapon_manager.cc
r5779 r5955 110 110 this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR); 111 111 this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR); 112 113 this->targetIterator = NULL;114 112 } 115 113 … … 337 335 } 338 336 } 339 }340 341 342 /**343 * Selects an Entity from the NPC-list, and returns the Target344 */345 PNode* WeaponManager::getSomeTarget()346 {347 if (this->targetIterator == NULL)348 {349 std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);350 if (npcList != NULL)351 {352 this->targetIterator = npcList->begin();353 }354 else355 return NULL;356 }357 358 ///FIXME359 // this->targetIterator++;360 PNode* retNode = dynamic_cast<PNode*>((*targetIterator));361 // if (retNode == NULL && this->targetIterator->getList()->getSize() > 0)362 // retNode = dynamic_cast<PNode*>(targetIterator->firstElement());363 364 return retNode;365 }366 367 368 /**369 * Selects an Entity from the Entity-List, that is near of the carrier PNode.370 * @param carrier: The PNode from which the distance should be measured371 * @param distance: The Maximum Distance to Return.372 */373 PNode* WeaponManager::getDistanceTarget(const PNode* carrier, float distance)374 {375 std::list<BaseObject*>* npcList = ClassList::getList(CL_NPC);376 if (npcList != NULL)377 {378 list<BaseObject*>::iterator node;379 for (node= npcList->begin(); node != npcList->end(); node++)380 if ((carrier->getAbsCoor() - dynamic_cast<PNode*>(*node)->getAbsCoor()).len() < distance)381 return dynamic_cast<PNode*>(*node);382 }383 return this->getFixedTarget();384 337 } 385 338 -
branches/powerups/src/world_entities/weapons/weapon_manager.h
r5779 r5955 80 80 /** @returns a fixed target namely the Crosshair's 3D position */ 81 81 inline PNode* getFixedTarget() const { return this->crosshair; }; 82 PNode* getSomeTarget();83 PNode* getDistanceTarget(const PNode* carrier, float distance);84 82 85 83 void fire(); … … 109 107 Crosshair* crosshair; //!< an aim. 110 108 tAnimation<Crosshair>* crossHairSizeAnim; //!< An animation for the crosshair (scaling) 111 112 std::list<BaseObject*>::iterator targetIterator; //!< An iterator for traversion lists of enemies.113 109 };
Note: See TracChangeset
for help on using the changeset viewer.