| Line | |
|---|
| 1 | /*! |
|---|
| 2 | * @file aiming_system.h |
|---|
| 3 | * Definition of |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | #ifndef _AIMING_SYSTEM_H |
|---|
| 7 | #define _AIMING_SYSTEM_H |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | #include "world_entity.h" |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | // FORWARD DECLARATION |
|---|
| 15 | class TiXmlElement; |
|---|
| 16 | class BVTree; |
|---|
| 17 | class Model; |
|---|
| 18 | class OBBTree; |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | class AimingSystem : public WorldEntity |
|---|
| 22 | { |
|---|
| 23 | ObjectListDeclaration(AimingSystem); |
|---|
| 24 | |
|---|
| 25 | public: |
|---|
| 26 | AimingSystem(WorldEntity* owner = NULL); |
|---|
| 27 | virtual ~AimingSystem(); |
|---|
| 28 | |
|---|
| 29 | void init(); |
|---|
| 30 | |
|---|
| 31 | WorldEntity* getNearestTarget(); |
|---|
| 32 | void flushList() { this->selectionList.clear(); } |
|---|
| 33 | |
|---|
| 34 | void setRange(float range){this->range = range;}; |
|---|
| 35 | |
|---|
| 36 | virtual void hit(float damage, WorldEntity* killer); |
|---|
| 37 | virtual void destroy(WorldEntity* entity) {} |
|---|
| 38 | |
|---|
| 39 | virtual void tick(float dt); |
|---|
| 40 | virtual void draw() const; |
|---|
| 41 | |
|---|
| 42 | |
|---|
| 43 | private: |
|---|
| 44 | float range; //!< |
|---|
| 45 | float sideLength; |
|---|
| 46 | std::vector<WorldEntity*> selectionList; //!< the selections |
|---|
| 47 | |
|---|
| 48 | WorldEntity* owner; //!< the owner of the targeting system |
|---|
| 49 | |
|---|
| 50 | OBBTree* obbTree; |
|---|
| 51 | |
|---|
| 52 | }; |
|---|
| 53 | |
|---|
| 54 | #endif /* _AIMING_SYSTEM_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.