- Timestamp:
- Nov 23, 2005, 9:41:24 PM (19 years ago)
- Location:
- branches/world_entities
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/world_entities/aclocal.m4
r5739 r5745 1 # generated automatically by aclocal 1.9. 5-*- Autoconf -*-1 # generated automatically by aclocal 1.9.6 -*- Autoconf -*- 2 2 3 3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, … … 29 29 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. 30 30 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], 31 [AM_AUTOMAKE_VERSION([1.9. 5])])31 [AM_AUTOMAKE_VERSION([1.9.6])]) 32 32 33 33 # AM_AUX_DIR_EXPAND -*- Autoconf -*- -
branches/world_entities/src/world_entities/player.cc
r5622 r5745 79 79 80 80 //weapons: 81 Weapon* wpRight = new TestGun( this->weaponMan,0);81 Weapon* wpRight = new TestGun(0); 82 82 wpRight->setName("testGun Right"); 83 Weapon* wpLeft = new TestGun( this->weaponMan,1);83 Weapon* wpLeft = new TestGun(1); 84 84 wpLeft->setName("testGun Left"); 85 85 Weapon* cannon = dynamic_cast<Weapon*>(Factory::getFirst()->fabricate(CL_CANNON)); 86 cannon->setWeaponManager(this->weaponMan); 86 87 87 cannon->setName("BFG"); 88 88 … … 344 344 //if (this->weaponMan->hasFreeSlot(2, WTYPE_TURRET)) 345 345 { 346 turret = new Turret( this->weaponMan);346 turret = new Turret(); 347 347 this->weaponMan->addWeapon(turret, 2); 348 348 this->weaponMan->changeWeaponConfig(2); … … 353 353 //if (this->weaponMan->hasFreeSlot(3)) 354 354 { 355 turret = new AimingTurret( this->weaponMan);355 turret = new AimingTurret(); 356 356 this->weaponMan->addWeapon(turret, 3); 357 357 -
branches/world_entities/src/world_entities/weapons/aiming_turret.cc
r5622 r5745 40 40 creates a new weapon 41 41 */ 42 AimingTurret::AimingTurret ( WeaponManager* weaponManager)43 : Weapon( weaponManager)42 AimingTurret::AimingTurret () 43 : Weapon() 44 44 { 45 45 this->init(); … … 143 143 return; 144 144 145 PNode* target = this->getWeaponManager()->getFixedTarget();146 147 if (target != NULL)148 {149 145 pj->setVelocity(/*this->getVelocity()+*/(this->getAbsDir().apply(Vector(1,0,0))*250.0 + VECTOR_RAND(13) 150 146 /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 151 }152 else153 pj->setVelocity(target->getVelocity());154 147 155 148 pj->setParent(NullParent::getInstance()); … … 168 161 void AimingTurret::draw () const 169 162 { 170 this->getWeaponManager()->getFixedTarget()->debugDraw(10);171 172 163 /* draw gun body */ 173 164 glMatrixMode(GL_MODELVIEW); -
branches/world_entities/src/world_entities/weapons/aiming_turret.h
r5559 r5745 15 15 { 16 16 public: 17 AimingTurret ( WeaponManager* weaponManager);17 AimingTurret (); 18 18 AimingTurret(const TiXmlElement* root); 19 19 virtual ~AimingTurret (); -
branches/world_entities/src/world_entities/weapons/cannon.cc
r5744 r5745 48 48 creates a new weapon 49 49 */ 50 Cannon::Cannon ( WeaponManager* weaponManager)51 : Weapon( weaponManager)50 Cannon::Cannon () 51 : Weapon() 52 52 { 53 53 this->init(); -
branches/world_entities/src/world_entities/weapons/cannon.h
r5621 r5745 13 13 { 14 14 public: 15 Cannon ( WeaponManager* weaponManager);15 Cannon (); 16 16 Cannon (const TiXmlElement* root); 17 17 virtual ~Cannon (); -
branches/world_entities/src/world_entities/weapons/test_gun.cc
r5622 r5745 48 48 creates a new weapon 49 49 */ 50 TestGun::TestGun ( WeaponManager* weaponManager,int leftRight)51 : Weapon( weaponManager)50 TestGun::TestGun ( int leftRight) 51 : Weapon() 52 52 { 53 53 this->init(); -
branches/world_entities/src/world_entities/weapons/test_gun.h
r5500 r5745 38 38 { 39 39 public: 40 TestGun ( WeaponManager* weaponManager,int leftRight);40 TestGun (int leftRight); 41 41 TestGun (const TiXmlElement* root); 42 42 virtual ~TestGun (); -
branches/world_entities/src/world_entities/weapons/turret.cc
r5622 r5745 40 40 creates a new weapon 41 41 */ 42 Turret::Turret ( WeaponManager* weaponManager)43 : Weapon( weaponManager)42 Turret::Turret () 43 : Weapon() 44 44 { 45 45 this->init(); … … 117 117 { 118 118 Quaternion quat; 119 Vector direction = this->get WeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();119 Vector direction = this->getAbsCoor();/*this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();*/ 120 120 121 121 direction.normalize(); … … 135 135 return; 136 136 137 PNode* target = this->getWeaponManager()->getFixedTarget();138 139 if (target != NULL)140 {141 137 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(13) 142 138 /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 143 }144 else145 pj->setVelocity(target->getVelocity());146 139 147 140 pj->setParent(NullParent::getInstance()); … … 159 152 void Turret::draw () const 160 153 { 161 this->getWeaponManager()->getFixedTarget()->debugDraw(10);162 163 154 /* draw gun body */ 164 155 glMatrixMode(GL_MODELVIEW); -
branches/world_entities/src/world_entities/weapons/turret.h
r5740 r5745 12 12 { 13 13 public: 14 Turret ( WeaponManager* weaponManager = NULL);14 Turret (); 15 15 Turret(const TiXmlElement* root); 16 16 virtual ~Turret (); -
branches/world_entities/src/world_entities/weapons/weapon.cc
r5500 r5745 41 41 * creates a new weapon 42 42 */ 43 Weapon::Weapon ( WeaponManager* weaponManager)43 Weapon::Weapon () 44 44 { 45 45 this->init(); 46 this->setWeaponManager(weaponManager);47 46 } 48 47 … … 97 96 this->energyMax = 10.0; //< How much energy can be carried 98 97 this->capability = WTYPE_ALL; //< The Weapon has all capabilities @see W_Capability. 99 100 this->setWeaponManager(NULL); //< By default the Weapon is free, and unhandled by a WeaponManager (this is good for small enemies).101 98 } 102 99 -
branches/world_entities/src/world_entities/weapons/weapon.h
r5500 r5745 81 81 public: 82 82 // INITIALISATION // 83 Weapon ( WeaponManager* weaponManager = NULL);83 Weapon (); 84 84 virtual ~Weapon (); 85 85 … … 92 92 float increaseEnergy(float energyToAdd); 93 93 /////////////////// 94 95 /** @param weaponManager sets the WeaponManager for this Weapon (NULL if free)) */96 inline void setWeaponManager(WeaponManager* weaponManager) { this->weaponManager = weaponManager; };97 /** @returns the WeaponManager of this Weapon (or NULL if it is free) */98 inline WeaponManager* getWeaponManager() const { return this->weaponManager; };99 94 100 95 /** @returns true if the Weapon is Active (this is used to check if the weapon must be drawn)*/ … … 220 215 ClassID projectile; //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.) 221 216 FastFactory* projectileFactory; //!< A factory, that produces and handles the projectiles. 222 223 WeaponManager* weaponManager; //!< The weaponManager this weapon is connected to. if NULL it is assumed, that the weapon is freely connected to an entity without a binding WeaponManager.224 217 }; 225 218
Note: See TracChangeset
for help on using the changeset viewer.