[Orxonox-commit 4586] r9257 - in code/trunk: data/levels src/modules/overlays/hud src/orxonox/infos src/orxonox/interfaces src/orxonox/worldentities/pawns
landauf at orxonox.net
landauf at orxonox.net
Mon May 28 12:28:44 CEST 2012
Author: landauf
Date: 2012-05-28 12:28:44 +0200 (Mon, 28 May 2012)
New Revision: 9257
Modified:
code/trunk/data/levels/missionOne.oxw
code/trunk/data/levels/underAttack.oxw
code/trunk/src/modules/overlays/hud/HUDNavigation.cc
code/trunk/src/orxonox/infos/PlayerInfo.cc
code/trunk/src/orxonox/interfaces/RadarViewable.cc
code/trunk/src/orxonox/interfaces/RadarViewable.h
code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
Log:
renamed RVName to radarname
cast to RadarViewable instead of SpaceShip to set the name (in PlayerInfo)
Modified: code/trunk/data/levels/missionOne.oxw
===================================================================
--- code/trunk/data/levels/missionOne.oxw 2012-05-28 07:06:02 UTC (rev 9256)
+++ code/trunk/data/levels/missionOne.oxw 2012-05-28 10:28:44 UTC (rev 9257)
@@ -508,7 +508,7 @@
</SimpleNotification>
<!-- @Objects: 4 boxes (uncontrolled pawns) -->
- <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 4" >
+ <Pawn team=1 health=30 position="0,0,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 4" >
<events>
<visibility>
<EventListener event="flying4" />
@@ -522,7 +522,7 @@
</collisionShapes>
</Pawn>
- <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box RVName = "Box 3">
+ <Pawn team=1 health=30 position="0,100,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box radarname = "Box 3">
<events>
<visibility>
<EventListener event="flying4" />
@@ -536,7 +536,7 @@
</collisionShapes>
</Pawn>
- <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 2">
+ <Pawn health=30 position="0,200,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 radarname = "Box 2">
<events>
<visibility>
<EventListener event="flying4" />
@@ -550,7 +550,7 @@
</collisionShapes>
</Pawn>
- <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 RVName = "Box 1">
+ <Pawn health=30 position="0,300,0" direction="0,-1,0" collisionType=dynamic mass=100000 name=box team=1 radarname = "Box 1">
<events>
<visibility>
<EventListener event="flying4" />
@@ -634,7 +634,7 @@
<!--------------------------------------PART TWO: Moving targets --------------------------------------->
<!-- @Objects: 2 pirates moving in squares, nonlethal -->
- <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" RVName="Pirate">
+ <SpaceShip position="0,2000,200" lookat="0,0,0" name="movingtarget" radarname="Pirate">
<events>
<visibility>
<EventListener event="boxtrigger4" />
@@ -655,7 +655,7 @@
</controller>
</SpaceShip>
- <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" RVName="Pirate">
+ <SpaceShip position="0,2000,400" lookat="0,0,0" name="movingtarget" radarname="Pirate">
<events>
<visibility>
<EventListener event="boxtrigger4" />
@@ -976,13 +976,13 @@
<!-- @Objects: HYDROGEN FARMER & DOCKING -->
<SpaceShip
- team = 0
- position = "-48900,100,0"
- roll = 90 yaw=0 pitch=20
- mass = 10000
- health = 100000 initialhealth=100000 maxhealth="100000"
- name = "HydroFarmer"
- RVName = "Hydrogen Farmer" >
+ team = 0
+ position = "-48900,100,0"
+ roll = 90 yaw=0 pitch=20
+ mass = 10000
+ health = 100000 initialhealth=100000 maxhealth="100000"
+ name = "HydroFarmer"
+ radarname = "Hydrogen Farmer" >
<attached>
<!-- Docking -->
<DistanceTriggerBeacon name="bcnDestroyer" />
@@ -1065,7 +1065,7 @@
reloadrate = "1"
reloadwaittime = "1"
name = "cruiser"
- RVName = "Spacecruiser" >
+ radarname = "Spacecruiser" >
<attached>
<DockingTarget name="spaceShip" />
</attached>
Modified: code/trunk/data/levels/underAttack.oxw
===================================================================
--- code/trunk/data/levels/underAttack.oxw 2012-05-28 07:06:02 UTC (rev 9256)
+++ code/trunk/data/levels/underAttack.oxw 2012-05-28 10:28:44 UTC (rev 9257)
@@ -55,7 +55,7 @@
health = 10000
maxhealth = 10000
initialhealth = 10000
- RVName = "Transporter"
+ radarname = "Transporter"
>
<attached>
Modified: code/trunk/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/trunk/src/modules/overlays/hud/HUDNavigation.cc 2012-05-28 07:06:02 UTC (rev 9256)
+++ code/trunk/src/modules/overlays/hud/HUDNavigation.cc 2012-05-28 10:28:44 UTC (rev 9257)
@@ -78,7 +78,7 @@
this->setFont ( "Monofur" );
this->setTextSize ( 0.05f );
this->setNavMarkerSize ( 0.05f );
- this->setDetectionLimit( 10000.0f );
+ this->setDetectionLimit( 10000.0f );
}
HUDNavigation::~HUDNavigation()
@@ -100,7 +100,7 @@
XMLPortParam ( HUDNavigation, "font", setFont, getFont, xmlelement, mode );
XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode );
XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
- XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
+ XMLPortParam ( HUDNavigation, "detectionLimit", setDetectionLimit, getDetectionLimit, xmlelement, mode );
}
void HUDNavigation::setFont ( const std::string& font )
@@ -145,16 +145,16 @@
}
float HUDNavigation::getArrowSizeX(int dist)
-{
- if (dist < 600)
+{
+ if (dist < 600)
dist = 600;
return this->getActualSize().x * 900 * navMarkerSize_ / dist;
}
float HUDNavigation::getArrowSizeY(int dist)
-{
+{
if (dist < 600)
- dist = 600;
+ dist = 600;
return this->getActualSize().y * 900 * navMarkerSize_ / dist;
}
@@ -183,8 +183,8 @@
{
ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
closeEnough_ = listIt->second < detectionLimit_ ;
- // display radarviewables on HUD if the marker limit and max-distance is not exceeded
- if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) )
+ // display radarviewables on HUD if the marker limit and max-distance is not exceeded
+ if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) )
{
@@ -200,8 +200,8 @@
//display name next to cursor
else{
- it->second.text_->setCaption(it->first->getRVName());
- textLength = it->first->getRVName().size() * it->second.text_->getCharHeight() * 0.3f;
+ it->second.text_->setCaption(it->first->getRadarName());
+ textLength = it->first->getRadarName().size() * it->second.text_->getCharHeight() * 0.3f;
}
// Transform to screen coordinates
@@ -310,7 +310,7 @@
it->second.panel_->show();
it->second.text_->show();
}
- else // do not display on HUD
+ else // do not display on HUD
{
it->second.panel_->hide();
it->second.text_->hide();
Modified: code/trunk/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/trunk/src/orxonox/infos/PlayerInfo.cc 2012-05-28 07:06:02 UTC (rev 9256)
+++ code/trunk/src/orxonox/infos/PlayerInfo.cc 2012-05-28 10:28:44 UTC (rev 9257)
@@ -35,7 +35,7 @@
#include "gametypes/Gametype.h"
#include "worldentities/ControllableEntity.h"
#include "controllers/Controller.h"
-#include "worldentities/pawns/SpaceShip.h"
+#include "interfaces/RadarViewable.h"
namespace orxonox
{
@@ -57,7 +57,7 @@
this->updateGametypeInfo();
this->registerVariables();
-
+
}
PlayerInfo::~PlayerInfo()
@@ -153,7 +153,7 @@
while (this->previousControllableEntity_.size() > 0)
this->stopTemporaryControl();
-
+
if (this->controllableEntity_)
this->stopControl();
@@ -171,11 +171,10 @@
}
this->changedControllableEntity();
- SpaceShip* spaceship = dynamic_cast<SpaceShip*>(entity);
- if (spaceship != NULL)
- {
- spaceship->setRVName(this->getName());
- }
+
+ RadarViewable* radarviewable = orxonox_cast<RadarViewable*>(entity);
+ if (radarviewable != NULL)
+ radarviewable->setRadarName(this->getName());
}
void PlayerInfo::startTemporaryControl(ControllableEntity* entity)
@@ -243,7 +242,7 @@
this->controllableEntity_->setController(0);
if(this->isHumanPlayer()) // TODO: Multiplayer?
this->controllableEntity_->destroyHud(); // HACK-ish
-
+
// this->controllableEntity_ = this->previousControllableEntity_.back();
do {
this->controllableEntity_ = this->previousControllableEntity_.back();
Modified: code/trunk/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.cc 2012-05-28 07:06:02 UTC (rev 9256)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.cc 2012-05-28 10:28:44 UTC (rev 9257)
@@ -50,7 +50,6 @@
, radarObjectShape_(Dot)
, radarObjectDescription_("staticObject")
, scale_(1.0f)
- , RVName("")
{
RegisterRootObject(RadarViewable);
Modified: code/trunk/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/interfaces/RadarViewable.h 2012-05-28 07:06:02 UTC (rev 9256)
+++ code/trunk/src/orxonox/interfaces/RadarViewable.h 2012-05-28 10:28:44 UTC (rev 9257)
@@ -60,16 +60,16 @@
RadarViewable(BaseObject* creator, const WorldEntity* wePtr);
virtual ~RadarViewable();
- virtual void setRVName(std::string name)
+ virtual void setRadarName(const std::string& name)
{
- if (this->RVName != name)
+ if (this->radarName_ != name)
{
- this->RVName = name;
+ this->radarName_ = name;
this->settingsChanged();
}
}
- std::string getRVName() const
- { return this->RVName; }
+ const std::string& getRadarName() const
+ { return this->radarName_; }
inline void setRadarObjectCamouflage(float camouflage)
{
@@ -162,7 +162,7 @@
std::string radarObjectDescription_;
ColourValue radarObjectColour_;
float scale_;
- std::string RVName;
+ std::string radarName_;
};
}
Modified: code/trunk/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2012-05-28 07:06:02 UTC (rev 9256)
+++ code/trunk/src/orxonox/worldentities/pawns/Pawn.cc 2012-05-28 10:28:44 UTC (rev 9257)
@@ -129,7 +129,7 @@
XMLPortParam(Pawn, "reloadrate", setReloadRate, getReloadRate, xmlelement, mode).defaultValues(0);
XMLPortParam(Pawn, "reloadwaittime", setReloadWaitTime, getReloadWaitTime, xmlelement, mode).defaultValues(1.0f);
- XMLPortParam ( RadarViewable, "RVName", setRVName, getRVName, xmlelement, mode );
+ XMLPortParam ( RadarViewable, "radarname", setRadarName, getRadarName, xmlelement, mode );
}
void Pawn::registerVariables()
More information about the Orxonox-commit
mailing list