Changeset 6920 in orxonox.OLD
- Timestamp:
- Jan 31, 2006, 10:37:09 PM (19 years ago)
- Location:
- trunk/src/world_entities/weapons
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/turret.cc
r6759 r6920 118 118 119 119 Quaternion quat; 120 Vector direction = this->getAbsCoor();/*this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();*/ 120 Vector direction; 121 if (this->getDefaultTarget() == NULL) 122 direction = this->getAbsCoor(); 123 else 124 direction = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor(); 121 125 122 126 direction.normalize(); -
trunk/src/world_entities/weapons/weapon.cc
r6756 r6920 87 87 this->emissionPoint.setParent(this); //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles 88 88 89 this-> target = NULL;//< Nothing is Targeted by default.89 this->defaultTarget = NULL; //< Nothing is Targeted by default. 90 90 91 91 this->projectile = CL_NULL; //< No Projectile Class is Connected to this weapon -
trunk/src/world_entities/weapons/weapon.h
r6803 r6920 127 127 inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); }; 128 128 129 inline void setTarget(PNode* target) { this->target = target; }; 129 inline void setDefaultTarget(PNode* defaultTarget) { this->defaultTarget = defaultTarget; }; 130 inline PNode* getDefaultTarget() const { return this->defaultTarget; }; 130 131 131 132 // STATE CHANGES // … … 211 212 GLGuiBar* energyWidget; 212 213 213 PNode* target;//!< A target for targeting Weapons.214 PNode* defaultTarget; //!< A target for targeting Weapons. 214 215 215 216 //////////// -
trunk/src/world_entities/weapons/weapon_manager.cc
r6918 r6920 281 281 if (this->parent->isA(CL_PLAYABLE)) 282 282 dynamic_cast<Playable*>(this->parent)->weaponConfigChanged(); 283 weapon->setDefaultTarget(this->crosshair); 283 284 } 284 285 PRINTF(3)("Added a new Weapon (%s::%s) to the WeaponManager: config %i/ slot %i\n", weapon->getClassName(), weapon->getName(), configID, slotID);
Note: See TracChangeset
for help on using the changeset viewer.