Changeset 5750 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Nov 24, 2005, 12:13:22 AM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 4 deleted
- 20 edited
- 15 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/Makefile.am
r5463 r5750 25 25 weapons/rocket.cc \ 26 26 weapons/laser.cc \ 27 weapons/ground_turret.cc \ 27 28 weapons/crosshair.cc \ 29 weapons/ground_turret.cc \ 28 30 power_ups/power_up.cc \ 29 31 power_ups/turret_power_up.cc \ -
trunk/src/world_entities/environment.cc
r5500 r5750 28 28 29 29 using namespace std; 30 CREATE_FACTORY(Environment );30 CREATE_FACTORY(Environment, CL_ENVIRONMENT); 31 31 32 32 /** -
trunk/src/world_entities/player.cc
r5636 r5750 28 28 #include "weapons/test_gun.h" 29 29 #include "weapons/turret.h" 30 #include "weapons/cannon.h" 30 31 31 32 #include "list.h" … … 37 38 using namespace std; 38 39 39 CREATE_FACTORY(Player );40 CREATE_FACTORY(Player, CL_PLAYER); 40 41 41 42 /** … … 46 47 { 47 48 this->init(); 48 49 //weapons:50 Weapon* wpRight = new TestGun(this->weaponMan, 0);51 Weapon* wpLeft = new TestGun(this->weaponMan, 1);52 53 this->weaponMan->addWeapon(wpRight);54 // this->weaponMan->addWeapon(wpLeft, WM_CONFIG1, WM_SLOT1);55 // this->weaponMan->addWeapon(wpRight, WM_CONFIG2);56 // this->weaponMan->addWeapon(wpLeft, WM_CONFIG2);57 49 } 58 50 … … 88 80 89 81 //weapons: 90 Weapon* wpRight = new TestGun( this->weaponMan,0);82 Weapon* wpRight = new TestGun(0); 91 83 wpRight->setName("testGun Right"); 92 Weapon* wpLeft = new TestGun( this->weaponMan,1);84 Weapon* wpLeft = new TestGun(1); 93 85 wpLeft->setName("testGun Left"); 86 Weapon* cannon = dynamic_cast<Weapon*>(Factory::getFirst()->fabricate(CL_CANNON)); 87 88 cannon->setName("BFG"); 94 89 95 90 this->weaponMan->addWeapon(wpLeft, 1, 0); 96 91 this->weaponMan->addWeapon(wpRight,1 ,1); 92 this->weaponMan->addWeapon(cannon, 0, 6); 93 97 94 //this->weaponMan->addWeapon(turret, 3, 0); 98 95 … … 134 131 135 132 this->weaponMan = new WeaponManager(this); 136 this->weaponMan->setSlotCount( 10);133 this->weaponMan->setSlotCount(7); 137 134 138 135 this->weaponMan->setSlotPosition(0, Vector(-2.6, .1, -3.0)); … … 153 150 this->weaponMan->setSlotPosition(5, Vector(-1.5, -.5, -.5)); 154 151 this->weaponMan->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0))); 155 156 this->weaponMan->setSlotPosition(6, Vector(-2.0, 0.1, -2.0)); 157 this->weaponMan->setSlotPosition(7, Vector(-2.0, 0.1, 2.0)); 158 159 this->weaponMan->setSlotPosition(8, Vector(-2.5, -0.3, -2.0)); 160 this->weaponMan->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0))); 161 162 this->weaponMan->setSlotPosition(9, Vector(-2.5, -0.3, 2.0)); 163 this->weaponMan->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0))); 152 // 153 this->weaponMan->setSlotPosition(6, Vector(-1, 0.0, 0)); 154 this->weaponMan->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 155 // 156 // this->weaponMan->setSlotPosition(8, Vector(-2.5, -0.3, -2.0)); 157 // this->weaponMan->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0))); 158 // 159 // this->weaponMan->setSlotPosition(9, Vector(-2.5, -0.3, 2.0)); 160 // this->weaponMan->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));: 161 164 162 } 165 163 … … 337 335 } 338 336 337 #include "weapons/aiming_turret.h" 339 338 // FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG 340 339 void Player::ADDWEAPON() 341 340 { 342 Weapon* turret1 = new Turret(this->weaponMan); 343 turret1->setName("Turret"); 344 turret1->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1); 345 346 this->weaponMan->addWeapon(turret1, 2); 347 348 this->weaponMan->changeWeaponConfig(2); 349 } 341 Weapon* turret = NULL; 342 343 if ((float)rand()/RAND_MAX < .1) 344 { 345 //if (this->weaponMan->hasFreeSlot(2, WTYPE_TURRET)) 346 { 347 turret = new Turret(); 348 this->weaponMan->addWeapon(turret, 2); 349 this->weaponMan->changeWeaponConfig(2); 350 } 351 } 352 else 353 { 354 //if (this->weaponMan->hasFreeSlot(3)) 355 { 356 turret = new AimingTurret(); 357 this->weaponMan->addWeapon(turret, 3); 358 359 this->weaponMan->changeWeaponConfig(3); 360 } 361 } 362 363 if(turret != NULL) 364 { 365 turret->setName("Turret"); 366 turret->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1); 367 } 368 } -
trunk/src/world_entities/power_ups/laser_power_up.cc
r5500 r5750 25 25 using namespace std; 26 26 27 CREATE_FACTORY(LaserPowerUp );27 CREATE_FACTORY(LaserPowerUp, CL_LASER_POWER_UP); 28 28 29 29 LaserPowerUp::LaserPowerUp () -
trunk/src/world_entities/power_ups/turret_power_up.cc
r5500 r5750 25 25 using namespace std; 26 26 27 CREATE_FACTORY(TurretPowerUp );27 CREATE_FACTORY(TurretPowerUp, CL_TURRET_POWER_UP); 28 28 29 29 TurretPowerUp::TurretPowerUp () -
trunk/src/world_entities/skybox.cc
r5671 r5750 25 25 using namespace std; 26 26 27 CREATE_FACTORY(SkyBox );27 CREATE_FACTORY(SkyBox, CL_SKYBOX); 28 28 29 29 /** -
trunk/src/world_entities/terrain.cc
r5671 r5750 29 29 using namespace std; 30 30 31 CREATE_FACTORY(Terrain );31 CREATE_FACTORY(Terrain, CL_TERRAIN); 32 32 33 33 /** -
trunk/src/world_entities/weapons/aim.cc
r5671 r5750 20 20 #include "load_param.h" 21 21 #include "graphics_engine.h" 22 #include "glincl.h"23 22 #include "state.h" 23 #include "list.h" 24 24 #include "material.h" 25 #include "t_animation.h" 26 #include "text.h" 27 28 #include "world_entity.h" 25 29 26 30 using namespace std; … … 30 34 * standart constructor 31 35 */ 32 Aim::Aim ( const TiXmlElement* root)36 Aim::Aim (PNode* source, const TiXmlElement* root) 33 37 { 34 38 this->init(); 39 40 this->source = source; 35 41 36 42 if (root) … … 47 53 if (this->material) 48 54 delete this->material; 55 56 if (this->text != NULL) 57 delete this->text; 49 58 } 50 59 … … 58 67 59 68 this->setLayer(E2D_LAYER_TOP); 60 this->setRotationSpeed( 5);69 this->setRotationSpeed(30.0* (float)rand()/RAND_MAX + 10.0); 61 70 this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0); 62 71 63 //this->setBindNode(this);72 this->setBindNode(this); 64 73 this->material = new Material; 65 } 66 74 this->source = NULL; 75 76 this->anim = new tAnimation<Aim>(this, &Aim::setSize); 77 this->anim->setInfinity(ANIM_INF_CONSTANT); 78 this->anim->addKeyFrame(500, .3, ANIM_LINEAR); 79 this->anim->addKeyFrame(100, .2, ANIM_LINEAR); 80 this->anim->addKeyFrame(50, .01, ANIM_LINEAR); 81 82 this->text = new Text(); 83 this->text->setParent2D(this); 84 this->text->setRelCoor2D(10, -50); 85 this->text->setParentMode2D(E2D_PARENT_MOVEMENT); 86 this->text->setText("Testing"); 87 } 67 88 68 89 void Aim::loadParams(const TiXmlElement* root) … … 80 101 } 81 102 103 void Aim::searchTarget(float range) 104 { 105 tIterator<WorldEntity>* iterator = State::getWorldEntityList()->getIterator(); 106 WorldEntity* entity = iterator->firstElement(); 107 while (likely(entity != NULL)) 108 { 109 if (entity->isA(CL_NPC) && this->source->getAbsCoor().x < entity->getAbsCoor().x && (this->source->getAbsCoor() - entity->getAbsCoor()).len() < range) 110 { 111 if (this->getParent() != entity) 112 { 113 this->anim->replay(); 114 this->setParentSoft(entity, 5); 115 } 116 delete iterator; 117 return; 118 } 119 entity = iterator->nextElement(); 120 } 121 122 delete iterator; 123 } 124 125 82 126 83 127 /** … … 108 152 this->shiftDir2D(dt * rotationSpeed); 109 153 110 111 float z = 0.0f; 112 glReadPixels ((int)this->getAbsCoor2D().x, 113 GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1, 114 1, 115 1, 116 GL_DEPTH_COMPONENT, 117 GL_FLOAT, 118 &z); 119 120 121 GLdouble objX=.0, objY=.0, objZ=.0; 122 gluUnProject(this->getAbsCoor2D().x, 123 GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1, 124 .99, // z 125 GraphicsEngine::modMat, 126 GraphicsEngine::projMat, 127 GraphicsEngine::viewPort, 128 &objX, 129 &objY, 130 &objZ ); 131 132 this->setAbsCoor(objX, objY, objZ); 154 char outputText[100]; 155 sprintf(outputText, "%s - distance: %f\n", this->getParent()->getName(), (this->source->getAbsCoor() - this->getAbsCoor()).len()); 156 this->text->setText(outputText); 157 158 159 if (this->source->getAbsCoor().x > this->getAbsCoor().x ) 160 this->searchTarget(1000); 161 // float z = 0.0f; 162 // glReadPixels ((int)this->getAbsCoor2D().x, 163 // GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1, 164 // 1, 165 // 1, 166 // GL_DEPTH_COMPONENT, 167 // GL_FLOAT, 168 // &z); 169 // 170 // 171 // GLdouble objX=.0, objY=.0, objZ=.0; 172 // gluUnProject(this->getAbsCoor2D().x, 173 // GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1, 174 // .99, // z 175 // GraphicsEngine::modMat, 176 // GraphicsEngine::projMat, 177 // GraphicsEngine::viewPort, 178 // &objX, 179 // &objY, 180 // &objZ ); 181 // 182 // this->setAbsCoor(objX, objY, objZ); 133 183 } 134 184 … … 138 188 void Aim::draw() const 139 189 { 190 140 191 glPushMatrix(); 141 192 glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0); -
trunk/src/world_entities/weapons/aim.h
r5557 r5750 12 12 // FORWARD DECLARATION 13 13 class Model; 14 class Text; 14 15 class Material; 15 16 class TiXmlElement; 17 template<class T> class tAnimation; 16 18 17 19 //! An Aim for zooming in on Targets. 20 /** 21 * An Aim is a PNode, that is connected, to the Target, it has aquired 22 * The target becomes, if selected its Parent. 23 * 24 * Also the Aim is a Element2D, as it draws a cross onto the Target. 25 */ 18 26 class Aim : public PNode, public Element2D { 19 27 20 28 public: 21 Aim( const TiXmlElement* root = NULL);29 Aim(PNode* source, const TiXmlElement* root = NULL); 22 30 virtual ~Aim(); 23 31 … … 25 33 void loadParams(const TiXmlElement* root); 26 34 35 inline void setSource(PNode* source) { this->source = source; }; 36 27 37 inline void selectTarget(PNode* target) { this->setParent(target); }; 28 38 inline PNode* getTarget(PNode* target) { return this->getParent(); }; 29 39 40 void searchTarget(float range); 30 41 31 42 void setSize(float size); … … 40 51 Material* material; //!< a material for the Aim. 41 52 float rotationSpeed; //!< Speed of the Rotation. 53 tAnimation<Aim>* anim; 54 55 PNode* source; //!< Where this Shot has come from. 56 57 Text* text; //!< A Text to display onto this Node. (distance to Target) 42 58 }; 43 59 -
trunk/src/world_entities/weapons/crosshair.cc
r5671 r5750 76 76 GraphicsEngine::showMouse(false); 77 77 GraphicsEngine::stealWMEvents(true); 78 SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2); 78 79 } 79 80 -
trunk/src/world_entities/weapons/laser.cc
r5687 r5750 84 84 Laser::explosionParticles->setName("LaserExplosionParticles"); 85 85 Laser::explosionParticles->setLifeSpan(.5, .3); 86 Laser::explosionParticles->setRadius(0.0, 3.0);86 Laser::explosionParticles->setRadius(0.0, 10.0); 87 87 Laser::explosionParticles->setRadius(.5, 6.0); 88 88 Laser::explosionParticles->setRadius(1.0, 3.0); -
trunk/src/world_entities/weapons/laser.h
r5500 r5750 42 42 43 43 WorldEntity* hitEntity; // FIXME TEMPORARY 44 45 44 }; 46 45 -
trunk/src/world_entities/weapons/test_gun.cc
r5500 r5750 41 41 using namespace std; 42 42 43 CREATE_FACTORY(TestGun );43 CREATE_FACTORY(TestGun, CL_TEST_GUN); 44 44 45 45 /** … … 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(); -
trunk/src/world_entities/weapons/test_gun.h
r5500 r5750 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 (); -
trunk/src/world_entities/weapons/turret.cc
r5512 r5750 30 30 #include "factory.h" 31 31 32 CREATE_FACTORY(Turret );32 CREATE_FACTORY(Turret, CL_TURRET); 33 33 34 34 using namespace std; 35 35 36 37 36 /** 38 37 * standard constructor 39 40 creates a new weapon41 */42 Turret::Turret ( WeaponManager* weaponManager)43 : Weapon( weaponManager)38 * 39 * creates a new Turret 40 */ 41 Turret::Turret () 42 : Weapon() 44 43 { 45 44 this->init(); … … 53 52 } 54 53 55 54 /** 55 * creates a new Turret from a TiXmlElement 56 */ 56 57 Turret::Turret(const TiXmlElement* root) 57 58 { … … 117 118 { 118 119 Quaternion quat; 119 Vector direction = this->get WeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();120 Vector direction = this->getAbsCoor();/*this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();*/ 120 121 121 122 direction.normalize(); … … 135 136 return; 136 137 137 PNode* target = this->getWeaponManager()->getFixedTarget();138 139 if (target != NULL)140 {141 138 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(13) 142 139 /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity()); 143 }144 else145 pj->setVelocity(target->getVelocity());146 140 147 141 pj->setParent(NullParent::getInstance()); … … 159 153 void Turret::draw () const 160 154 { 161 this->getWeaponManager()->getFixedTarget()->debugDraw(10);162 163 155 /* draw gun body */ 164 156 glMatrixMode(GL_MODELVIEW); -
trunk/src/world_entities/weapons/turret.h
r5511 r5750 12 12 { 13 13 public: 14 Turret ( WeaponManager* weaponManager);14 Turret (); 15 15 Turret(const TiXmlElement* root); 16 16 virtual ~Turret (); -
trunk/src/world_entities/weapons/weapon.cc
r5671 r5750 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 -
trunk/src/world_entities/weapons/weapon.h
r5500 r5750 81 81 public: 82 82 // INITIALISATION // 83 Weapon ( WeaponManager* weaponManager = NULL);83 Weapon (); 84 84 virtual ~Weapon (); 85 85 … … 93 93 /////////////////// 94 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 100 95 /** @returns true if the Weapon is Active (this is used to check if the weapon must be drawn)*/ 101 inline bool isActive() const { return (this->currentState == WS_INACTIVE)? false:true; };96 inline bool isActive() const { return (this->currentState == WS_INACTIVE)? false : true; }; 102 97 /** @returns true if the weapon must be drawn */ 103 inline bool isVisible() const { return (this->currentState != WS_INACTIVE || !this->hideInactive) ?true:false; };98 inline bool isVisible() const { return (this->currentState != WS_INACTIVE || !this->hideInactive) ? true : false; }; 104 99 /** @returns true if the Weapon is chargeable */ 105 100 inline bool isChargeable() const { return this->chargeable; }; … … 120 115 121 116 117 // EMISSION 122 118 void setEmissionPoint(const Vector& point); 123 119 /** @see void setEmissionPoint(const Vector& point); */ … … 126 122 inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); }; 127 123 124 // STATE CHANGES // 128 125 /** @param state the State to time @param duration the duration of the State */ 129 126 inline void setStateDuration(const char* state, float duration) { setStateDuration(charToState(state), duration); }; … … 131 128 inline void setStateDuration(WeaponState state, float duration) { /*(state < WS_STATE_COUNT)?*/this->times[state] = duration; }; 132 129 /** @param state The state to query @returns the Time the queried State takes to complete */ 133 inline float getStateDuration(WeaponState state) const { return (state < WS_STATE_COUNT)? this->times[state]:0.0; };130 inline float getStateDuration(WeaponState state) const { return (state < WS_STATE_COUNT)? this->times[state] : 0.0; }; 134 131 /** @returns true if the time of the currentState is elapsed, false otherwise */ 135 inline bool stateTimeElapsed() const { return (this->stateDuration > this->times[currentState])? true:false; };132 inline bool stateTimeElapsed() const { return (this->stateDuration > this->times[currentState])? true : false; }; 136 133 /** @returns the current State of the Weapon */ 137 134 inline WeaponState getCurrentState() const { return this->currentState; }; … … 149 146 // FLOW 150 147 void tickW(float dt); //!< this is a function that must be called by the weaponManager, or any other weaponHandler, all other functions are handled from within 148 151 149 virtual void tick(float dt) {}; 152 150 virtual void draw() const; … … 194 192 // it is all about energy 195 193 float energy; //!< The energy stored in the weapons secondary buffers (reserve) 196 float energyLoaded; //!< The energy stored in the weapons primary buffers (fire without reload)194 float energyLoaded; //!< The energy stored in the weapons primary buffers (fire without reload) 197 195 float energyMax; //!< The maximal energy that can be stored in the secondary buffers (reserveMax) 198 196 float energyLoadedMax; //!< The maximal energy that can be stored in the primary buffers … … 220 218 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 219 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 220 }; 225 221 -
trunk/src/world_entities/weapons/weapon_manager.cc
r5671 r5750 23 23 #include "crosshair.h" 24 24 25 #include "class_list.h" 25 26 #include "load_param.h" 26 27 #include "factory.h" 27 #include "vector.h"28 28 #include "list.h" 29 29 #include "t_animation.h" 30 30 #include "null_parent.h" 31 31 32 32 33 using namespace std; … … 109 110 this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR); 110 111 this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR); 112 113 this->targetIterator = NULL; 111 114 } 112 115 … … 334 337 } 335 338 } 339 } 340 341 342 /** 343 * Selects an Entity from the NPC-list, and returns the Target 344 */ 345 PNode* WeaponManager::getSomeTarget() 346 { 347 if (this->targetIterator == NULL) 348 { 349 tList<BaseObject>* npcList = ClassList::getList(CL_NPC); 350 if (npcList != NULL) 351 { 352 this->targetIterator = npcList->getIterator(); 353 this->targetIterator->firstElement(); 354 } 355 else 356 return NULL; 357 } 358 359 PNode* retNode = dynamic_cast<PNode*>(targetIterator->nextElement()); 360 if (retNode == NULL && this->targetIterator->getList()->getSize() > 0) 361 retNode = dynamic_cast<PNode*>(targetIterator->firstElement()); 362 363 return retNode; 364 } 365 366 367 /** 368 * Selects an Entity from the Entity-List, that is near of the carrier PNode. 369 * @param carrier: The PNode from which the distance should be measured 370 * @param distance: The Maximum Distance to Return. 371 */ 372 PNode* WeaponManager::getDistanceTarget(const PNode* carrier, float distance) 373 { 374 tList<BaseObject>* npcList = ClassList::getList(CL_NPC); 375 if (npcList != NULL) 376 { 377 tIterator<BaseObject>* npcIT = npcList->getIterator(); 378 PNode* tmpNPC = dynamic_cast<PNode*>(npcIT->firstElement()); 379 while (tmpNPC != NULL) 380 { 381 if ((carrier->getAbsCoor() - tmpNPC->getAbsCoor()).len() < distance) 382 { 383 delete npcIT; 384 return tmpNPC; 385 } 386 tmpNPC = dynamic_cast<PNode*>(npcIT->nextElement()); 387 } 388 delete npcIT; 389 } 390 return this->getFixedTarget(); 391 336 392 } 337 393 -
trunk/src/world_entities/weapons/weapon_manager.h
r5453 r5750 17 17 // FORWARD DECLARATION 18 18 template <class T> class tAnimation; 19 template <class T> class tIterator; 19 20 20 21 … … 70 71 void removeWeapon(Weapon* weapon, int configID = -1); 71 72 72 73 // FIXME :: 74 // bool hasFreeSlot(int configID, long capability = WTYPE_ALL) { return ( getNextFreeSlot(configID, capability ) != -1)? true : false; }; 73 75 74 76 void nextWeaponConfig(); … … 77 79 78 80 /** @returns a fixed target namely the Crosshair's 3D position */ 79 inline PNode* getFixedTarget() { return this->crosshair; }; 81 inline PNode* getFixedTarget() const { return this->crosshair; }; 82 PNode* getSomeTarget(); 83 PNode* getDistanceTarget(const PNode* carrier, float distance); 84 80 85 void fire(); 86 //! @TODO: implement this function (maybe also in Weapon itself) 87 void releaseFire(); 81 88 82 89 void tick(float dt); … … 85 92 void debug() const; 86 93 87 private:94 // private: 88 95 int getNextFreeSlot(int configID, long capability = WTYPE_ALL); 89 96 … … 102 109 Crosshair* crosshair; //!< an aim. 103 110 tAnimation<Crosshair>* crossHairSizeAnim; //!< An animation for the crosshair (scaling) 111 112 tIterator<BaseObject>* targetIterator; //!< An iterator for traversion lists of enemies. 104 113 };
Note: See TracChangeset
for help on using the changeset viewer.