Changeset 6716 for code/branches/hudelements/src
- Timestamp:
- Apr 13, 2010, 2:31:14 PM (15 years ago)
- Location:
- code/branches/hudelements/src/orxonox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/hudelements/src/orxonox/controllers/HumanController.cc
r6417 r6716 35 35 #include "gametypes/Gametype.h" 36 36 #include "infos/PlayerInfo.h" 37 #include "overlays/Map.h"38 37 #include "Radar.h" 39 38 #include "Scene.h" … … 116 115 void HumanController::yaw(const Vector2& value) 117 116 { 118 //Hack to enable mouselook in map119 if ( Map::getSingletonPtr() && Map::getSingletonPtr()->getVisibility() && HumanController::localController_s->controllableEntity_->isInMouseLook() )120 {121 Map::getSingletonPtr()->rotateYaw(value);122 return;123 }124 117 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 125 118 HumanController::localController_s->controllableEntity_->rotateYaw(value); … … 128 121 void HumanController::pitch(const Vector2& value) 129 122 { 130 //Hack to enable mouselook in map131 if ( Map::getSingletonPtr() && Map::getSingletonPtr()->getVisibility() && HumanController::localController_s->controllableEntity_->isInMouseLook() )132 {133 Map::getSingletonPtr()->rotatePitch(value);134 return;135 }136 123 if (HumanController::localController_s && HumanController::localController_s->controllableEntity_) 137 124 HumanController::localController_s->controllableEntity_->rotatePitch(value); -
code/branches/hudelements/src/orxonox/gamestates/GSGraphics.cc
r6417 r6716 39 39 #include "core/Game.h" 40 40 #include "core/GUIManager.h" 41 // HACK:42 #include "overlays/Map.h"43 41 44 42 namespace orxonox … … 73 71 void GSGraphics::deactivate() 74 72 { 75 // HACK: (destroys a resource smart pointer) 76 Map::hackDestroyMap(); 73 77 74 } 78 75 -
code/branches/hudelements/src/orxonox/interfaces/RadarViewable.cc
r6417 r6716 39 39 #include "Radar.h" 40 40 #include "Scene.h" 41 #include "overlays/Map.h"42 41 43 42 namespace orxonox … … 47 46 */ 48 47 RadarViewable::RadarViewable() 49 : MapNode_(NULL) 50 , MapEntity_(NULL) 51 , line_(NULL) 52 , LineNode_(NULL) 53 , isHumanShip_(false) 48 : isHumanShip_(false) 54 49 , bVisibility_(true) 55 50 , radarObjectCamouflage_(0.0f) … … 60 55 61 56 this->uniqueId_=getUniqueNumberString(); 62 /*63 if(Map::getSingletonPtr() && Map::getSingletonPtr()->getMapSceneManagerPtr())64 {65 this->addEntity();66 }67 68 */69 57 } 70 58 … … 72 60 RadarViewable::~RadarViewable() 73 61 { 74 if (this->isHumanShip_ && MapNode_)75 MapNode_->removeAllChildren();76 77 if (MapNode_)78 delete MapNode_;79 80 if (MapEntity_)81 delete MapEntity_;82 83 if (line_)84 delete line_;85 86 if (LineNode_)87 delete LineNode_;88 }89 90 void RadarViewable::addMapEntity()91 { //TODO Check shape and add accordantly92 if( this->MapNode_ && !this->MapEntity_ && Map::getSingletonPtr() && Map::getSingletonPtr()->getMapSceneManagerPtr() )93 {94 COUT(0) << "Adding " << this->uniqueId_ << " to Map.\n";95 this->MapEntity_ = Map::getSingletonPtr()->getMapSceneManagerPtr()->createEntity( this->uniqueId_, "drone.mesh");96 /*this->line_ = Map::getSingletonPtr()->getMapSceneManagerPtr()->createManualObject(this->uniqueId_ + "_l");97 this->line_->begin("Map/line_", Ogre::RenderOperation::OT_LINE_STRIP);98 //line_->position(0, -it->getRVWorldPosition().y, 0);99 //this->line_->position(0, -20, 0);100 this->line_->position(0, 0, -10); //Front Arrow101 this->line_->position(0, 0, 0);102 103 this->line_->end(); */104 this->line_ = new Ogre::DynamicLines(Ogre::RenderOperation::OT_LINE_LIST);105 this->line_->addPoint( Vector3(0,0,0) );106 this->line_->addPoint( Vector3(0,0,0) );107 108 this->MapNode_->attachObject( this->MapEntity_ );109 110 this->LineNode_ = this->MapNode_->createChildSceneNode();111 this->LineNode_->attachObject( this->line_ );112 }113 else114 {115 COUT(0) << "Unable to load " << this->uniqueId_ << " to Map.\n";116 }117 }118 119 void RadarViewable::updateMapPosition()120 {121 if( this->MapNode_ )122 {123 this->MapNode_->setPosition( this->getRVWorldPosition() );124 this->MapNode_->translate( this->getRVOrientedVelocity(), static_cast<Ogre::Node::TransformSpace>(3) );125 this->MapNode_->setOrientation( this->getWorldEntity()->getOrientation() );126 //Vector3 v = this->getRVWorldPosition();127 //this->line_->setPoint(1, Vector3(0,v.y,0) );128 this->line_->setPoint(1, Vector3( 0, static_cast<float>(static_cast<int>( -Map::getSingletonPtr()->movablePlane_->getDistance( this->getRVWorldPosition() ) ) ) ,0 ));129 this->line_->update();130 if( Map::getSingletonPtr()->playerShipNode_ )131 this->LineNode_->setDirection( Map::getSingletonPtr()->playerShipNode_->getLocalAxes().GetColumn(1) ,Ogre::Node::TS_WORLD,Vector3::UNIT_Y);132 }133 62 } 134 63 -
code/branches/hudelements/src/orxonox/interfaces/RadarViewable.h
r5781 r6716 88 88 { return this->radarObjectShape_; } 89 89 90 /* 91 inline void setMapNode(Ogre::SceneNode * node) 92 { this->MapNode_ = node; } 93 inline Ogre::SceneNode * getMapNode() const 94 { return this->MapNode_; } 95 inline void setMapEntity(Ogre::Entity * ent) 96 { this->MapEntity_ = ent; } 97 inline Ogre::Entity * getMapEntity() const 98 { return this->MapEntity_; } 99 */ 100 //Used for Map 101 Ogre::SceneNode * MapNode_; 102 Ogre::Entity * MapEntity_; 103 Ogre::DynamicLines* line_; 104 Ogre::SceneNode * LineNode_; 105 void addMapEntity(); 106 void updateMapPosition(); 90 107 91 bool isHumanShip_; 108 92 inline const std::string& getUniqueId()
Note: See TracChangeset
for help on using the changeset viewer.