Changeset 1614 for code/branches/hud/src/orxonox/RadarListener.h
- Timestamp:
- Jun 21, 2008, 2:35:24 PM (16 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/RadarListener.h
r1613 r1614 27 27 */ 28 28 29 #ifndef _Radar Viewable_H__30 #define _Radar Viewable_H__29 #ifndef _RadarListener_H__ 30 #define _RadarListener_H__ 31 31 32 32 #include "OrxonoxPrereqs.h" 33 #include <string>34 33 #include "core/OrxonoxClass.h" 35 #include "util/Math.h"36 34 37 35 namespace orxonox 38 36 { 39 /** 40 @brief Interface for receiving window events. 41 */ 42 class _OrxonoxExport RadarViewable : virtual public OrxonoxClass 37 class _OrxonoxExport RadarListener : virtual public OrxonoxClass 43 38 { 44 39 public: 45 enum Shape 46 { 47 Square, 48 Dot, 49 Triangle 50 }; 40 RadarListener(); 41 virtual ~RadarListener() { } 51 42 52 public: 53 RadarViewable(); 54 virtual ~RadarViewable() { }//unregisterFromRadar(); } 55 56 float getRadarObjectCamouflage() const { return this->radarObjectCamouflage_; } 57 void setRadarObjectCamouflage(float camouflage) { this->radarObjectCamouflage_ = camouflage; } 58 59 const ColourValue& getRadarObjectColour() const { return this->radarObjectColour_; } 60 void setRadarObjectColour(const ColourValue& colour) { this->radarObjectColour_ = colour; } 61 62 const std::string& getRadarObjectDescription() const { return this->radarObjectDescription_; } 63 void setRadarObjectDescription(const std::string& str); 64 65 const WorldEntity* getWorldEntity() const { return this->radarObject_; } 66 const Vector3& getWorldPosition() const { validate(); return this->radarObject_->getWorldPosition(); } 67 Vector3 getOrientedVelocity() const 68 { validate(); return this->radarObject_->getOrientation() * this->radarObject_->getVelocity(); } 69 70 Shape getRadarObjectType() const { return this->radarObjectType_; } 71 72 protected: 73 WorldEntity* radarObject_; 74 //void unregisterFromRadar(); 75 76 private: 77 void validate() const { if (!this->radarObject_) 78 { COUT(1) << "Assertation: Every RadarViewable has to be assigned a WorldEntity pointer!" << std::endl; assert(0); } } 79 80 float radarObjectCamouflage_; 81 Shape radarObjectType_; 82 std::string radarObjectDescription_; 83 ColourValue radarObjectColour_; 43 virtual void displayObject(RadarViewable* viewable, bool bIsMarked) = 0; 44 virtual float getRadarSensitivity() = 0; 45 virtual void radarTick(float dt) = 0; 84 46 }; 85 47 } 86 48 87 #endif /* _Radar Viewable_H__ */49 #endif /* _RadarListener_H__ */
Note: See TracChangeset
for help on using the changeset viewer.