Changeset 6054 in orxonox.OLD for trunk/src/world_entities/weapons
- Timestamp:
- Dec 11, 2005, 6:23:42 PM (19 years ago)
- Location:
- trunk/src/world_entities/weapons
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/aim.cc
r5779 r6054 65 65 this->setClassID(CL_CROSSHAIR, "Aim"); 66 66 this->setName("Aim"); 67 68 this->addNodeModeFlags(PNODE_REPARENT_TO_NULLPARENT); 67 69 68 70 this->setLayer(E2D_LAYER_TOP); -
trunk/src/world_entities/weapons/guided_missile.cc
r5994 r6054 152 152 { 153 153 //Vector v = *this->flightDirection * ( this->speed * time * 1000 + 0.1); 154 if (target != NULL && target->getParent() != NullParent::getInstance())154 if (target.getParent() != NullParent::getInstance()) 155 155 { 156 velocity += ((target ->getAbsCoor() - this->getAbsCoor()).getNormalized())*agility;156 velocity += ((target.getAbsCoor() - this->getAbsCoor()).getNormalized())*agility; 157 157 float speed = velocity.len(); 158 158 if (speed > this->maxVelocity) -
trunk/src/world_entities/weapons/guided_missile.h
r5766 r6054 9 9 #include "projectile.h" 10 10 11 class Vector;12 11 class Weapon; 13 12 class ParticleSystem; -
trunk/src/world_entities/weapons/projectile.cc
r5994 r6054 38 38 this->lifeCycle = 0.0; 39 39 this->lifeSpan = 1.0f; /* sec */ 40 this->target = NULL; 40 this->target.addNodeModeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT | 41 PNODE_REPARENT_TO_NULLPARENT); 41 42 42 43 this->removeNode(); … … 103 104 void Projectile::setTarget(PNode* target) 104 105 { 105 106 if (this->target == NULL) 107 this->target = new PNode(); 108 this->target->setParent(target); 106 this->target.setParent(target); 109 107 } 110 108 -
trunk/src/world_entities/weapons/projectile.h
r5994 r6054 55 55 Vector velocity; //!< velocity of the projectile. 56 56 57 PNode *target; //!< A target for guided Weapons.57 PNode target; //!< A target for guided Weapons. 58 58 }; 59 59 -
trunk/src/world_entities/weapons/weapon.cc
r5930 r6054 528 528 tick(dt); 529 529 } 530 531 /**532 * this will draw the weapon533 */534 void Weapon::draw () const535 {}536 537 530 538 531 -
trunk/src/world_entities/weapons/weapon.h
r5750 r6054 148 148 149 149 virtual void tick(float dt) {}; 150 virtual void draw() const;151 150 152 151 bool check() const; -
trunk/src/world_entities/weapons/weapon_manager.cc
r5982 r6054 35 35 36 36 /** 37 * this initializes the weaponManager for a given nnumber of weapon slots37 * @brief this initializes the weaponManager for a given nnumber of weapon slots 38 38 * @param number of weapon slots of the model/ship <= 8 (limitied) 39 39 */ … … 51 51 52 52 /** 53 * Destroys a WeaponManager53 * @brief Destroys a WeaponManager 54 54 */ 55 55 WeaponManager::~WeaponManager() … … 60 60 61 61 /** 62 * initializes the WeaponManager62 * @brief initializes the WeaponManager 63 63 */ 64 64 void WeaponManager::init()
Note: See TracChangeset
for help on using the changeset viewer.