Changeset 9177 for code/branches/waypoints/src/modules/overlays
- Timestamp:
- May 11, 2012, 4:20:50 PM (13 years ago)
- Location:
- code/branches/waypoints/src/modules/overlays/hud
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/waypoints/src/modules/overlays/hud/HUDNavigation.cc
r9159 r9177 46 46 #include "Radar.h" 47 47 #include "graphics/Camera.h" 48 #include "graphics/Model.h" 49 #include "worldentities/MovableEntity.h" 48 50 #include "controllers/HumanController.h" 49 51 #include "worldentities/pawns/Pawn.h" … … 82 84 this->setDetectionLimit( 10000.0f ); 83 85 84 Ogre::Entity* ent = this->getScene()->getSceneManager()->createEntity("Arrow3D", "Arrow3D.mesh"); 85 this->add3DMesh(ent); 86 this->overlay3d_->setPosition(0, 0, -10); 86 //Ogre::Entity* ent = this->getScene()->getSceneManager()->createEntity("Arrow3D", "Arrow3D.mesh"); 87 88 Model* arrow = new Model(this); 89 MovableEntity* arrowEntity = new MovableEntity(this); 90 arrow->setMeshSource("Arrow3D.mesh"); 91 arrowEntity->attach(arrow); 92 arrowEntity->setVisible(true); 93 arrowEntity->scale(1); 94 arrowEntity->setPosition(0, 0, -200); 95 arrowEntity->attachToNode(this->overlay3d_); 96 //this->add3DMesh(arrowEntity); 97 98 this->overlay3d_->setPosition(0, 0, -200); 99 this->overlay3d_->setVisible(false, true); 87 100 } 88 101 … … 183 196 unsigned int markerCount_ = 0; 184 197 bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player 198 199 //for the first element of sortedObjectList_ / the closest waypoint show the Arrow3D 200 if(!sortedObjectList_.empty()) 201 { 202 showArrow3D(); 203 sortedList::iterator firstIt = sortedObjectList_.begin(); 204 Ogre::Vector3 pos1 = firstIt->first->getRVWorldPosition(); 205 Ogre::Vector3 pos2 = cam->getPosition(); 206 Ogre::Quaternion quat = pos2.getRotationTo(pos1); 207 this->overlay3d_->rotate(quat); 208 //this->overlay3d_->setDirection(pos1-pos2); 209 } 210 185 211 186 212 // for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it) … … 450 476 } 451 477 } 452 453 } 478 void HUDNavigation::showArrow3D() 479 { this->overlay3d_->setVisible(true, true);} 480 void HUDNavigation::hideArrow3D() 481 { this->overlay3d_->setVisible(false, true);} 482 483 484 } -
code/branches/waypoints/src/modules/overlays/hud/HUDNavigation.h
r9016 r9177 42 42 #include "overlays/OrxonoxOverlay.h" 43 43 44 44 45 namespace orxonox 45 46 { … … 51 52 52 53 void setConfigValues(); 54 55 53 56 54 57 virtual void XMLPort ( Element& xmlelement, XMLPort::Mode mode ); … … 80 83 81 84 }; 85 86 void showArrow3D(); 87 void hideArrow3D(); 82 88 83 89 bool showObject( RadarViewable* rv );
Note: See TracChangeset
for help on using the changeset viewer.