Changeset 1564 for code/trunk/src/orxonox/hud/RadarObject.cc
- Timestamp:
- Jun 8, 2008, 5:46:52 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/hud/RadarObject.cc
r1563 r1564 23 23 * Felix Schulthess 24 24 * Co-authors: 25 * ...25 * Fabian 'x3n' Landau 26 26 * 27 27 */ … … 35 35 36 36 #include "GraphicsEngine.h" 37 #include "objects/WorldEntity.h" 37 38 #include "util/Convert.h" 38 39 … … 43 44 { 44 45 public: 45 bool operator()(const orxonox::ColourValue& __x, const orxonox::ColourValue& __y) 46 bool operator()(const orxonox::ColourValue& __x, const orxonox::ColourValue& __y) const 46 47 { 47 48 if (__x.r == __y.r) … … 68 69 std::map<std::string, std::map<ColourValue, std::string> > RadarObject::materials_s; 69 70 70 RadarObject::RadarObject(Ogre::OverlayContainer* container, Ogre::SceneNode* node, const ColourValue& colour, const std::string& texturename)71 RadarObject::RadarObject(Ogre::OverlayContainer* container, WorldEntity* object, const ColourValue& colour, const std::string& texturename) 71 72 { 72 73 this->colour_ = colour; 73 74 this->texturename_ = texturename; 74 75 75 this->container_ = container; 76 this->node_ = node; 76 this->object_ = object; 77 77 78 this->panel_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "RadarObject" + getConvertedValue<unsigned int, std::string>(RadarObject::count_s )));78 this->panel_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "RadarObject" + getConvertedValue<unsigned int, std::string>(RadarObject::count_s++))); 79 79 this->setMaterial(colour, texturename); 80 80 81 this->panel_->setDimensions(3, 3);81 this->panel_->setDimensions(3, 3); 82 82 this->panel_->setMetricsMode(Ogre::GMM_PIXELS); 83 83 this->panel_->show(); 84 84 85 this->index_ = count_s++; 86 this->container_->addChild(panel_); 85 container->addChild(panel_); 87 86 } 88 87 89 88 RadarObject::~RadarObject() 90 89 { 91 delete panel_;90 Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->panel_); 92 91 } 93 92 … … 116 115 } 117 116 118 Vector3 RadarObject::getPosition()117 const Vector3& RadarObject::getPosition() const 119 118 { 120 return node_->getPosition();119 return this->object_->getPosition(); 121 120 } 122 121 123 Ogre::SceneNode* RadarObject::getNode()122 const Vector3& RadarObject::getVelocity() const 124 123 { 125 return node_;124 return this->object_->getVelocity(); 126 125 } 127 126 }
Note: See TracChangeset
for help on using the changeset viewer.