Changeset 1613 for code/branches/hud/src/orxonox/RadarViewable.h
- Timestamp:
- Jun 20, 2008, 12:05:12 AM (16 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hud/src/orxonox/RadarViewable.h
r1609 r1613 43 43 { 44 44 public: 45 enum Shape 46 { 47 Square, 48 Dot, 49 Triangle 50 }; 51 52 public: 45 53 RadarViewable(); 46 virtual ~RadarViewable() { unregisterFromRadar(); }54 virtual ~RadarViewable() { }//unregisterFromRadar(); } 47 55 48 void unregisterFromRadar(); 49 50 float getRadarObjectVisibility() const { return this->radarObjectVisibility_; } 51 void setRadarObjectVisibility(float visibility) { this->radarObjectVisibility_ = visibility; } 52 53 const std::string& getRadarObjectType() const { return this->radarObjectType_; } 54 void setRadarObjectType(const std::string& type) { this->radarObjectType_ = type; } 56 float getRadarObjectCamouflage() const { return this->radarObjectCamouflage_; } 57 void setRadarObjectCamouflage(float camouflage) { this->radarObjectCamouflage_ = camouflage; } 55 58 56 59 const ColourValue& getRadarObjectColour() const { return this->radarObjectColour_; } 57 60 void setRadarObjectColour(const ColourValue& colour) { this->radarObjectColour_ = colour; } 58 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 59 76 private: 60 float radarObjectVisibility_; 61 WorldEntity* radarObject_; 62 std::string radarObjectType_; 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_; 63 83 ColourValue radarObjectColour_; 64 84 };
Note: See TracChangeset
for help on using the changeset viewer.