Changeset 9945 for code/trunk/src/modules/overlays/hud
- Timestamp:
- Jan 3, 2014, 1:50:22 PM (11 years ago)
- Location:
- code/trunk/src/modules/overlays/hud
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/overlays/hud/HUDRadar.cc
r9939 r9945 71 71 72 72 this->map3DFront_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() 73 73 .createOverlayElement("Panel", "HUDRadar_mapDreiDFront_" + getUniqueNumberString())); 74 74 this->map3DFront_->setMaterialName("Orxonox/Radar3DFront"); 75 75 this->overlay_->add2D(this->map3DFront_); … … 77 77 78 78 this->map3DBack_ = static_cast<Ogre::PanelOverlayElement*>(Ogre::OverlayManager::getSingleton() 79 79 .createOverlayElement("Panel", "HUDRadar_mapDreiDBack_" + getUniqueNumberString())); 80 80 this->map3DBack_->setMaterialName("Orxonox/Radar3DBack"); 81 81 this->overlay_->add2D(this->map3DBack_); … … 189 189 if(RadarMode_) 190 190 { 191 192 193 194 195 191 this->setBackgroundMaterial(material3D_); 192 this->map3DFront_->_notifyZOrder(this->overlay_->getZOrder() * 100 + 250); // it seems that the ZOrder of overlayelements is 100 times the ZOrder of the overlay 193 this->map3DBack_->_notifyZOrder(this->overlay_->getZOrder() * 100 - 250); // 250 a little bit buffer so that the two shels are displayed all in the front / in the back 194 this->map3DFront_->show(); 195 this->map3DBack_->show(); 196 196 } 197 197 else 198 198 { 199 200 201 199 this->setBackgroundMaterial(material2D_); 200 this->map3DFront_->hide(); 201 this->map3DBack_->hide(); 202 202 } 203 203 … … 218 218 float size; 219 219 if(RadarMode_) 220 220 size = maximumDotSize3D_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale(); 221 221 else 222 222 size = maximumDotSize_ * halfDotSizeDistance_ / (halfDotSizeDistance_ + distance) * it->first->getRadarObjectScale(); 223 223 it->second->setDimensions(size, size); 224 224 … … 228 228 if(RadarMode_) 229 229 { 230 231 232 233 234 235 236 237 238 239 230 coord = get3DProjection(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), 0.6435011, detectionLimit_); 231 232 // set zOrder on screen 233 bool overXZPlain = isObjectHigherThanShipOnMap(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), this->mapAngle_); 234 235 int zOrder = determineMap3DZOrder(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition(), detectionLimit_); 236 if(overXZPlain == false /*&& (it->second->getZOrder() > 100 * this->overlay_->getZOrder())*/) // it appears that zOrder of attached Overlayelements is 100 times the zOrder of the Overlay 237 it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 - 70 + zOrder); 238 if(overXZPlain == true /*&& (it->second->getZOrder() <= 100 * this->overlay_->getZOrder())*/) 239 it->second->_notifyZOrder(this->overlay_->getZOrder() * 100 + 70 + zOrder); 240 240 } 241 241 else 242 242 coord = get2DViewcoordinates(this->owner_->getPosition(), this->owner_->getOrientation() * WorldEntity::FRONT, this->owner_->getOrientation() * WorldEntity::UP, wePointer->getWorldPosition()); 243 243 244 244 coord *= math::pi / 3.5f; // small adjustment to make it fit the texture … … 256 256 this->marker_->setPosition((1.0f + coord.x - size * 1.5f) * 0.5f, (1.0f - coord.y - size * 1.5f) * 0.5f); 257 257 if(RadarMode_) 258 258 this->marker_->_notifyZOrder(it->second->getZOrder() -1); 259 259 this->marker_->show(); 260 260 } -
code/trunk/src/modules/overlays/hud/HUDRadar.h
r9939 r9945 111 111 float mapAngle_; 112 112 113 std::string material2D_; 114 std::string material3D_; 113 std::string material2D_; //Material name for 2D map 114 std::string material3D_; //Material names For the 3D minimap 115 115 std::string material3DFront_; 116 116 std::string material3DBack_;
Note: See TracChangeset
for help on using the changeset viewer.