Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/presentation/src/world_entities/npcs/adm_turret.h @ 10703

Last change on this file since 10703 was 10703, checked in by retolu, 18 years ago

explosion, when deleted

File size: 1.9 KB
Line 
1/*
2* file groundTurret.h
3* A weapon that is fix located, and automatically shooting at a target.
4*/
5
6#ifndef _ADM_TURRET_H
7#define _ADM_TURRET_H
8
9//#include "sound_buffer.h"
10//#include "sound_source.h"
11
12#include "world_entity.h"
13#include "weapons/bsp_weapon.h"
14
15
16class AdmTurret : public WorldEntity
17      {
18                   ObjectListDeclaration(AdmTurret);
19      public:
20                   AdmTurret ();
21                   AdmTurret (const  TiXmlElement* root);
22                   virtual ~AdmTurret();
23                   
24                   void init();
25                   void loadParams(const TiXmlElement* root);
26                   
27                   virtual void tick(float dt);
28                   virtual void draw() const;
29                   virtual void collidesWith(WorldEntity* entity, const Vector& location);
30                   
31                   virtual void activate();
32                   virtual void deactivate();
33                   
34                   virtual void setTarget(const std::string& target);
35                   
36                   virtual void destroy(WorldEntity* killer);
37                   
38      private:
39                   WorldEntity* cannons;
40                   WorldEntity* sensor;
41                   WorldEntity* myTarget;
42
43                   void addCannons(const TiXmlElement* root);
44                   void addSensor(const TiXmlElement* root);
45                   void addWeapon(const TiXmlElement* root);
46
47                   void moveTowards( Vector targetDir, float dt );
48                   
49                   float bodyAngle;
50                   float cannonAngle;
51                   
52                   bool isActive;
53                   float range;
54                   
55                   bool isCeil;
56                   void setType( const std::string& type );
57                   
58                   bool playerVisible;
59                   void updatePlayerVisible();
60
61                BspWeapon* weapon;
62      };
63
64#endif
65
Note: See TracBrowser for help on using the repository browser.