Changeset 9257 for code/trunk
- Timestamp:
- May 28, 2012, 12:28:44 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/data/levels/missionOne.oxw
r9016 r9257 509 509 510 510 <!-- @Objects: 4 boxes (uncontrolled pawns) --> 511 <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >511 <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 4" > 512 512 <events> 513 513 <visibility> … … 523 523 </Pawn> 524 524 525 <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3">525 <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 3"> 526 526 <events> 527 527 <visibility> … … 537 537 </Pawn> 538 538 539 <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 2">539 <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 radarname = "Box 2"> 540 540 <events> 541 541 <visibility> … … 551 551 </Pawn> 552 552 553 <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 1">553 <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 radarname = "Box 1"> 554 554 <events> 555 555 <visibility> … … 635 635 636 636 <!-- @Objects: 2 pirates moving in squares, nonlethal --> 637 <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" RVName="Pirate">637 <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" radarname="Pirate"> 638 638 <events> 639 639 <visibility> … … 656 656 </SpaceShip> 657 657 658 <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" RVName="Pirate">658 <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" radarname="Pirate"> 659 659 <events> 660 660 <visibility> … … 977 977 <!-- @Objects: HYDROGEN FARMER & DOCKING --> 978 978 <SpaceShip 979 team = 0980 position = "-48900,100,0"981 roll = 90 yaw=0 pitch=20982 mass = 10000983 health = 100000 initialhealth=100000 maxhealth="100000"984 name = "HydroFarmer"985 RVName= "Hydrogen Farmer" >979 team = 0 980 position = "-48900,100,0" 981 roll = 90 yaw=0 pitch=20 982 mass = 10000 983 health = 100000 initialhealth=100000 maxhealth="100000" 984 name = "HydroFarmer" 985 radarname = "Hydrogen Farmer" > 986 986 <attached> 987 987 <!-- Docking --> … … 1066 1066 reloadwaittime = "1" 1067 1067 name = "cruiser" 1068 RVName= "Spacecruiser" >1068 radarname = "Spacecruiser" > 1069 1069 <attached> 1070 1070 <DockingTarget name="spaceShip" /> -
code/trunk/data/levels/underAttack.oxw
r9016 r9257 56 56 maxhealth = 10000 57 57 initialhealth = 10000 58 RVName= "Transporter"58 radarname = "Transporter" 59 59 > 60 60 -
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
r9016 r9257 79 79 this->setTextSize ( 0.05f ); 80 80 this->setNavMarkerSize ( 0.05f ); 81 this->setDetectionLimit( 10000.0f ); 81 this->setDetectionLimit( 10000.0f ); 82 82 } 83 83 … … 101 101 XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode ); 102 102 XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode ); 103 XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode ); 103 XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode ); 104 104 } 105 105 … … 146 146 147 147 float HUDNavigation::getArrowSizeX(int dist) 148 { 149 if (dist < 600) 148 { 149 if (dist < 600) 150 150 dist = 600; 151 151 return this->getActualSize().x * 900 * navMarkerSize_ / dist; … … 153 153 154 154 float HUDNavigation::getArrowSizeY(int dist) 155 { 155 { 156 156 if (dist < 600) 157 dist = 600; 157 dist = 600; 158 158 return this->getActualSize().y * 900 * navMarkerSize_ / dist; 159 159 } … … 184 184 ObjectMap::iterator it = activeObjectList_.find ( listIt->first ); 185 185 closeEnough_ = listIt->second < detectionLimit_ ; 186 // display radarviewables on HUD if the marker limit and max-distance is not exceeded 187 if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) ) 186 // display radarviewables on HUD if the marker limit and max-distance is not exceeded 187 if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) ) 188 188 { 189 189 … … 201 201 //display name next to cursor 202 202 else{ 203 it->second.text_->setCaption(it->first->getR VName());204 textLength = it->first->getR VName().size() * it->second.text_->getCharHeight() * 0.3f;203 it->second.text_->setCaption(it->first->getRadarName()); 204 textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f; 205 205 } 206 206 … … 311 311 it->second.text_->show(); 312 312 } 313 else // do not display on HUD 313 else // do not display on HUD 314 314 { 315 315 it->second.panel_->hide(); -
code/trunk/src/orxonox/infos/PlayerInfo.cc
r9016 r9257 36 36 #include "worldentities/ControllableEntity.h" 37 37 #include "controllers/Controller.h" 38 #include " worldentities/pawns/SpaceShip.h"38 #include "interfaces/RadarViewable.h" 39 39 40 40 namespace orxonox … … 58 58 59 59 this->registerVariables(); 60 60 61 61 } 62 62 … … 154 154 while (this->previousControllableEntity_.size() > 0) 155 155 this->stopTemporaryControl(); 156 156 157 157 if (this->controllableEntity_) 158 158 this->stopControl(); … … 172 172 173 173 this->changedControllableEntity(); 174 SpaceShip* spaceship = dynamic_cast<SpaceShip*>(entity); 175 if (spaceship != NULL) 176 { 177 spaceship->setRVName(this->getName()); 178 } 174 175 RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity); 176 if (radarviewable != NULL) 177 radarviewable->setRadarName(this->getName()); 179 178 } 180 179 … … 244 243 if(this->isHumanPlayer()) // TODO: Multiplayer? 245 244 this->controllableEntity_->destroyHud(); // HACK-ish 246 245 247 246 // this->controllableEntity_ = this->previousControllableEntity_.back(); 248 247 do { -
code/trunk/src/orxonox/interfaces/RadarViewable.cc
r9016 r9257 51 51 , radarObjectDescription_("staticObject") 52 52 , scale_(1.0f) 53 , RVName("")54 53 { 55 54 RegisterRootObject(RadarViewable); -
code/trunk/src/orxonox/interfaces/RadarViewable.h
r9016 r9257 61 61 virtual ~RadarViewable(); 62 62 63 virtual void setR VName(std::stringname)63 virtual void setRadarName(const std::string& name) 64 64 { 65 if (this-> RVName!= name)65 if (this->radarName_ != name) 66 66 { 67 this-> RVName= name;67 this->radarName_ = name; 68 68 this->settingsChanged(); 69 69 } 70 70 } 71 std::string getRVName() const72 { return this-> RVName; }71 const std::string& getRadarName() const 72 { return this->radarName_; } 73 73 74 74 inline void setRadarObjectCamouflage(float camouflage) … … 163 163 ColourValue radarObjectColour_; 164 164 float scale_; 165 std::string RVName;165 std::string radarName_; 166 166 }; 167 167 } -
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
r9254 r9257 130 130 XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f); 131 131 132 XMLPortParam ( RadarViewable, " RVName", setRVName, getRVName, xmlelement, mode );132 XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode ); 133 133 } 134 134
Note: See TracChangeset
for help on using the changeset viewer.