[1818] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
| 23 | * Reto Grieder |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | #ifndef _RadarViewable_H__ |
---|
| 30 | #define _RadarViewable_H__ |
---|
| 31 | |
---|
| 32 | #include "OrxonoxPrereqs.h" |
---|
[3157] | 33 | |
---|
[1818] | 34 | #include <string> |
---|
| 35 | #include <cassert> |
---|
[3157] | 36 | |
---|
[1818] | 37 | #include "util/Math.h" |
---|
[3192] | 38 | #include "util/OgreForwardRefs.h" |
---|
[1818] | 39 | #include "core/OrxonoxClass.h" |
---|
| 40 | |
---|
| 41 | namespace orxonox |
---|
| 42 | { |
---|
| 43 | /** |
---|
| 44 | @brief Interface for receiving window events. |
---|
| 45 | */ |
---|
| 46 | class _OrxonoxExport RadarViewable : virtual public OrxonoxClass |
---|
| 47 | { |
---|
| 48 | public: |
---|
| 49 | enum Shape |
---|
| 50 | { |
---|
| 51 | Square, |
---|
| 52 | Dot, |
---|
| 53 | Triangle |
---|
| 54 | }; |
---|
| 55 | |
---|
[3089] | 56 | |
---|
[1818] | 57 | public: |
---|
| 58 | RadarViewable(); |
---|
[3089] | 59 | virtual ~RadarViewable(); |
---|
[1818] | 60 | |
---|
[2662] | 61 | inline void setRadarObjectCamouflage(float camouflage) |
---|
| 62 | { this->radarObjectCamouflage_ = camouflage; } |
---|
| 63 | inline float getRadarObjectCamouflage() const |
---|
| 64 | { return this->radarObjectCamouflage_; } |
---|
[1818] | 65 | |
---|
[2662] | 66 | inline void setRadarObjectColour(const ColourValue& colour) |
---|
| 67 | { this->radarObjectColour_ = colour; } |
---|
| 68 | inline const ColourValue& getRadarObjectColour() const |
---|
| 69 | { return this->radarObjectColour_; } |
---|
[1818] | 70 | |
---|
| 71 | void setRadarObjectDescription(const std::string& str); |
---|
[2662] | 72 | inline const std::string& getRadarObjectDescription() const |
---|
| 73 | { return this->radarObjectDescription_; } |
---|
[1818] | 74 | |
---|
[3064] | 75 | inline void setRadarVisibility(bool b) |
---|
| 76 | { this->bVisibility_ = b; } |
---|
| 77 | inline bool getRadarVisibility() const |
---|
| 78 | { return this->bVisibility_; } |
---|
| 79 | |
---|
[2662] | 80 | virtual const WorldEntity* getWorldEntity() const = 0; |
---|
[1818] | 81 | |
---|
[2662] | 82 | const Vector3& getRVWorldPosition() const; |
---|
| 83 | Vector3 getRVOrientedVelocity() const; |
---|
[1818] | 84 | |
---|
[2662] | 85 | inline void setRadarObjectShape(Shape shape) |
---|
| 86 | { this->radarObjectShape_ = shape; } |
---|
| 87 | inline Shape getRadarObjectShape() const |
---|
| 88 | { return this->radarObjectShape_; } |
---|
[1818] | 89 | |
---|
[3089] | 90 | /* |
---|
| 91 | inline void setMapNode(Ogre::SceneNode * node) |
---|
| 92 | { this->MapNode_ = node; } |
---|
| 93 | inline Ogre::SceneNode * getMapNode() const |
---|
| 94 | { return this->MapNode_; } |
---|
| 95 | inline void setMapEntity(Ogre::Entity * ent) |
---|
| 96 | { this->MapEntity_ = ent; } |
---|
| 97 | inline Ogre::Entity * getMapEntity() const |
---|
| 98 | { return this->MapEntity_; } |
---|
| 99 | */ |
---|
| 100 | //Used for Map |
---|
| 101 | Ogre::SceneNode * MapNode_; |
---|
| 102 | Ogre::Entity * MapEntity_; |
---|
[3130] | 103 | Ogre::DynamicLines* line_; |
---|
[3089] | 104 | Ogre::SceneNode * LineNode_; |
---|
| 105 | void addMapEntity(); |
---|
| 106 | void updateMapPosition(); |
---|
| 107 | bool isHumanShip_; |
---|
[3157] | 108 | inline const std::string& getUniqueId() |
---|
[3089] | 109 | { |
---|
| 110 | return this->uniqueId_; |
---|
| 111 | } |
---|
[3101] | 112 | //friend class Map; |
---|
[3089] | 113 | |
---|
[1818] | 114 | private: |
---|
[3182] | 115 | void validate(const WorldEntity* object) const; |
---|
[3064] | 116 | bool bVisibility_; |
---|
[3089] | 117 | //Map |
---|
| 118 | std::string uniqueId_; |
---|
| 119 | |
---|
| 120 | |
---|
| 121 | //Radar |
---|
[1818] | 122 | float radarObjectCamouflage_; |
---|
[2662] | 123 | Shape radarObjectShape_; |
---|
[1818] | 124 | std::string radarObjectDescription_; |
---|
| 125 | ColourValue radarObjectColour_; |
---|
[3089] | 126 | |
---|
[1818] | 127 | }; |
---|
| 128 | } |
---|
| 129 | |
---|
| 130 | #endif /* _RadarViewable_H__ */ |
---|