[Orxonox-commit 4317] r8988 - in code/branches/presentation2011: . data/gui/scripts data/levels data/overlays src/modules/overlays/hud src/orxonox/controllers src/orxonox/infos src/orxonox/interfaces src/orxonox/worldentities/pawns
smerkli at orxonox.net
smerkli at orxonox.net
Wed Dec 14 16:45:22 CET 2011
Author: smerkli
Date: 2011-12-14 16:45:22 +0100 (Wed, 14 Dec 2011)
New Revision: 8988
Modified:
code/branches/presentation2011/
code/branches/presentation2011/data/gui/scripts/MiscConfigMenu.lua
code/branches/presentation2011/data/levels/underAttack.oxw
code/branches/presentation2011/data/overlays/HUDTemplates3.oxo
code/branches/presentation2011/src/modules/overlays/hud/CMakeLists.txt
code/branches/presentation2011/src/modules/overlays/hud/HUDHealthBar.h
code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.cc
code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.h
code/branches/presentation2011/src/orxonox/controllers/NewHumanController.h
code/branches/presentation2011/src/orxonox/infos/PlayerInfo.cc
code/branches/presentation2011/src/orxonox/interfaces/RadarViewable.cc
code/branches/presentation2011/src/orxonox/interfaces/RadarViewable.h
code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc
Log:
merged hud branch
Property changes on: code/branches/presentation2011
___________________________________________________________________
Modified: svn:mergeinfo
- /code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/steering:5949-6091,8140-8595
/code/branches/tetris:8100-8563
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
+ /code/branches/ai:6592-7033
/code/branches/ai2:8721-8880
/code/branches/bigships:8137-8588
/code/branches/buildsystem:1874-2276,2278-2400
/code/branches/buildsystem2:2506-2658
/code/branches/buildsystem3:2662-2708
/code/branches/ceguilua:1802-1808
/code/branches/chat:6527-6797
/code/branches/chat2:6836-6910
/code/branches/console:5941-6104
/code/branches/consolecommands2:6451-7178
/code/branches/consolecommands3:7178-7283
/code/branches/core3:1572-1739
/code/branches/core4:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
/code/branches/core5:5768-5928,6009
/code/branches/data_cleanup:7537-7686
/code/branches/doc:7290-7400
/code/branches/dockingsystem:8101-8192
/code/branches/dockingsystem2:8196-8560
/code/branches/dynamicmatch:6584-7030
/code/branches/environment3:8887-8975
/code/branches/fps:6591-7072
/code/branches/gamecontent:8893-8968
/code/branches/gameimmersion:8102-8577
/code/branches/gamestate:6430-6572,6621-6661
/code/branches/gamestates2:6594-6745
/code/branches/gametypes:2826-3031
/code/branches/gcc43:1580
/code/branches/gui:1635-1723,2795-2894
/code/branches/hud:8883-8986
/code/branches/hudelements:6584-6941
/code/branches/hudimprovements:7920-8672
/code/branches/ingamemenu:6000-6023
/code/branches/input:1629-1636
/code/branches/ipv6:7293-7458
/code/branches/kicklib:7940-8096,8098-8277
/code/branches/kicklib2:8282-8350
/code/branches/lastmanstanding:7479-7644
/code/branches/lastmanstanding3:7903-8175
/code/branches/libraries:5612-5692
/code/branches/libraries2:5703-5737
/code/branches/lod:6586-6911
/code/branches/lodfinal:2372-2411
/code/branches/mac_osx:7789-8128,8135
/code/branches/map:2801-3086,3089
/code/branches/masterserver:7502-7738
/code/branches/masterserverfix:8933-8936
/code/branches/menu:5941-6146,6148,7536-7687
/code/branches/menue:8884-8976
/code/branches/miniprojects:2754-2824
/code/branches/netp2:2835-2988
/code/branches/netp3:2988-3082
/code/branches/netp6:3214-3302
/code/branches/network:2356
/code/branches/network2:6434-6465
/code/branches/network3:7196-7344
/code/branches/network4:7497-7755
/code/branches/network5:7757-7781
/code/branches/network6:7823-8315
/code/branches/network64:2210-2355
/code/branches/notifications:7314-7401
/code/branches/objecthierarchy:1911-2085,2100,2110-2169
/code/branches/objecthierarchy2:2171-2479
/code/branches/ois_update:7506-7788
/code/branches/output:8739-8857
/code/branches/overlay:2117-2385
/code/branches/particles:2829-3085
/code/branches/particles2:6050-6106,6109
/code/branches/pch:3113-3194
/code/branches/physics:1912-2055,2107-2439
/code/branches/physics_merge:2436-2457
/code/branches/pickup:8145-8555
/code/branches/pickup2:5942-6405
/code/branches/pickup3:6418-6523
/code/branches/pickup4:6594-6710
/code/branches/pickups:1926-2086,2127,2827-2915
/code/branches/pickups2:2107-2497,2915-3071
/code/branches/png2:7262-7263
/code/branches/portals:8087-8455
/code/branches/portals2:8460-8602
/code/branches/ppspickups1:6552-6708
/code/branches/ppspickups2:6527-6532,6554-6709
/code/branches/ppspickups3:6757-6997
/code/branches/ppspickups4:7003-7089
/code/branches/presentation:2369-2652,2654-2660,7736-7786,8500-8705
/code/branches/presentation2:6106-6416,7787-7800
/code/branches/presentation3:6913-7162
/code/branches/questsystem:1894-2088
/code/branches/questsystem2:2107-2259
/code/branches/questsystem5:2776-2905
/code/branches/releasetodo:7614-7647
/code/branches/resource:3327-3366
/code/branches/resource2:3372-5694
/code/branches/rocket:6523-6950
/code/branches/rocket2:6953-6970
/code/branches/script_trigger:1295-1953,1955
/code/branches/skybox2:6559-6989
/code/branches/sound:2829-3010
/code/branches/sound3:5941-6102
/code/branches/spaceboundaries:8085-8457
/code/branches/spaceboundaries2:8460-8613
/code/branches/spacerace:8182-8630
/code/branches/steering:5949-6091,8140-8595
/code/branches/tetris:8100-8563
/code/branches/tutoriallevel:7827-8370
/code/branches/tutoriallevel2:8370-8452
/code/branches/tutoriallevel3:8453-8636
/code/branches/unity_build:8440-8716
/code/branches/usability:7915-8078
/code/branches/weapon:1925-2094
/code/branches/weapon2:2107-2488
/code/branches/weapons:2897-3051,8143-8591
/code/branches/weaponsystem:2742-2890
Modified: code/branches/presentation2011/data/gui/scripts/MiscConfigMenu.lua
===================================================================
--- code/branches/presentation2011/data/gui/scripts/MiscConfigMenu.lua 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/data/gui/scripts/MiscConfigMenu.lua 2011-12-14 15:45:22 UTC (rev 8988)
@@ -35,6 +35,8 @@
table.insert(P.commandList, "HumanPlayer nick_")
table.insert(P.commandList, "ChatOverlay displayTime_")
table.insert(P.commandList, "Core bDevMode_")
+ table.insert(P.commandList, "HUDNavigation MarkerLimit_")
+ table.insert(P.commandList, "HUDNavigation showDistance")
P.nameList = {}
table.insert(P.nameList, "Mouse sensitivity")
@@ -55,6 +57,8 @@
table.insert(P.nameList, "Playername")
table.insert(P.nameList, "Chat: display time")
table.insert(P.nameList, "Developer's Mode")
+ table.insert(P.nameList, "Marker Limit")
+ table.insert(P.nameList, "Show Distance next to cursor")
P.linesList = {}
Modified: code/branches/presentation2011/data/levels/underAttack.oxw
===================================================================
--- code/branches/presentation2011/data/levels/underAttack.oxw 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/data/levels/underAttack.oxw 2011-12-14 15:45:22 UTC (rev 8988)
@@ -55,6 +55,7 @@
health = 10000
maxhealth = 10000
initialhealth = 10000
+ RVName = "Transporter"
>
<attached>
Modified: code/branches/presentation2011/data/overlays/HUDTemplates3.oxo
===================================================================
--- code/branches/presentation2011/data/overlays/HUDTemplates3.oxo 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/data/overlays/HUDTemplates3.oxo 2011-12-14 15:45:22 UTC (rev 8988)
@@ -77,6 +77,27 @@
<BarColour position = 1.0 colour = "0.2,0.7,0.2" />
</HUDBoostBar>
+ <HUDEnemyHealthBar
+ name = "EnemyHealthBar"
+ background = "Orxonox/HealthBarBackground"
+ size = "0.35, 0.0875"
+ position = "1.0 , 0.1 "
+ pickpoint = "1, 1"
+ bartexture = "healthbar_bar.png"
+ textfont = "VeraMono"
+ textusebarcolour = true
+ textsize = 0.039
+ textoffset = "0.315, 0.05"
+ textpickpoint = "0, 0"
+ textalign = "right"
+ correctaspect = false
+ textcorrectaspect = false
+ >
+ <BarColour position = 0.0 colour = "0.7,0.2,0.2" />
+ <BarColour position = 0.5 colour = "0.7,0.7,0.2" />
+ <BarColour position = 1.0 colour = "0.2,0.7,0.2" />
+ </HUDEnemyHealthBar>
+
<HUDNavigation
name = "Navigation"
correctaspect = true
Modified: code/branches/presentation2011/src/modules/overlays/hud/CMakeLists.txt
===================================================================
--- code/branches/presentation2011/src/modules/overlays/hud/CMakeLists.txt 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/src/modules/overlays/hud/CMakeLists.txt 2011-12-14 15:45:22 UTC (rev 8988)
@@ -6,6 +6,7 @@
HUDBoostBar.cc
HUDHealthBar.cc
HUDTimer.cc
+ HUDEnemyHealthBar.cc
ChatOverlay.cc
AnnounceMessage.cc
KillMessage.cc
Modified: code/branches/presentation2011/src/modules/overlays/hud/HUDHealthBar.h
===================================================================
--- code/branches/presentation2011/src/modules/overlays/hud/HUDHealthBar.h 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/src/modules/overlays/hud/HUDHealthBar.h 2011-12-14 15:45:22 UTC (rev 8988)
@@ -109,6 +109,11 @@
inline float getTextSpaceWidth() const
{ return this->textoverlay_->getSpaceWidth(); }
+ inline void setOverlayText(SmartPtr<OverlayText> textoverlay)
+ { this->textoverlay_ = textoverlay; }
+ inline SmartPtr<OverlayText> getOverlayText() const
+ {return this->textoverlay_; }
+
private:
WeakPtr<Pawn> owner_;
SmartPtr<OverlayText> textoverlay_;
Modified: code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.cc 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.cc 2011-12-14 15:45:22 UTC (rev 8988)
@@ -24,6 +24,7 @@
* Co-authors:
* Reto Grieder
* Oliver Scheuss
+ * Matthias Spalinger
*
*/
@@ -62,7 +63,7 @@
void HUDNavigation::setConfigValues()
{
SetConfigValue(markerLimit_, 3);
-
+ SetConfigValue(showDistance, false);
}
CreateFactory ( HUDNavigation );
@@ -77,7 +78,6 @@
setFont ( "Monofur" );
setTextSize ( 0.05f );
setNavMarkerSize ( 0.05f );
- setDetectionLimit( 10000.0f );
}
HUDNavigation::~HUDNavigation()
@@ -96,10 +96,9 @@
{
SUPER ( HUDNavigation, XMLPort, xmlelement, mode );
- 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, "font", setFont, getFont, xmlelement, mode );
+ XMLPortParam ( HUDNavigation, "textSize", setTextSize, getTextSize, xmlelement, mode );
+ XMLPortParam ( HUDNavigation, "navMarkerSize", setNavMarkerSize, getNavMarkerSize, xmlelement, mode );
}
void HUDNavigation::setFont ( const std::string& font )
@@ -143,7 +142,19 @@
return textSize_;
}
+float HUDNavigation::getArrowSizeX(int dist)
+{
+ if (dist < 600)
+ dist = 600;
+ return this->getActualSize().x * 900 * navMarkerSize_ / dist;
+}
+float HUDNavigation::getArrowSizeY(int dist)
+{
+ if (dist < 600)
+ dist = 600;
+ return this->getActualSize().y * 900 * navMarkerSize_ / dist;
+}
void HUDNavigation::tick ( float dt )
{
@@ -163,21 +174,32 @@
sortedObjectList_.sort ( compareDistance );
unsigned int markerCount_ = 0;
- bool closeEnough_ = false; //only display objects that are close enough to be relevant for the player
+
// for (ObjectMap::iterator it = activeObjectList_.begin(); it != activeObjectList_.end(); ++it)
for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++markerCount_, ++listIt )
{
ObjectMap::iterator it = activeObjectList_.find ( listIt->first );
- closeEnough_ = listIt->second < detectionLimit_ ;
- if ( markerCount_ < markerLimit_ && (closeEnough_ || detectionLimit_ < 0) ) // display on HUD if the statement is true
+
+ if ( markerCount_ < markerLimit_ )
{
// Get Distance to HumanController and save it in the TextAreaOverlayElement.
int dist = listIt->second;
+ float textLength = 0.0f;
+
+ //display distance next to cursor
+ if (showDistance){
it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
- float textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
+ textLength = multi_cast<std::string> ( dist ).size() * it->second.text_->getCharHeight() * 0.3f;
+ }
+ //display name next to cursor
+ else{
+ it->second.text_->setCaption(it->first->getRVName());
+ textLength = it->first->getRVName().size() * it->second.text_->getCharHeight() * 0.3f;
+ }
+
// Transform to screen coordinates
Vector3 pos = camTransform * it->first->getRVWorldPosition();
@@ -193,8 +215,6 @@
}
else
outOfView = pos.x < -1.0 || pos.x > 1.0 || pos.y < -1.0 || pos.y > 1.0;
- // Get Distance to HumanController and save it in the TextAreaOverlayElement.
- it->second.text_->setCaption ( multi_cast<std::string> ( dist ) );
if ( outOfView )
{
@@ -207,6 +227,12 @@
it->second.wasOutOfView_ = true;
}
+ //float xDistScale = this->getActualSize().x * 1000.0f * navMarkerSize_ / dist;
+ //float yDistScale = this->getActualSize().y * 1000.0f * navMarkerSize_ / dist;
+
+ // Adjust Arrowsize according to distance
+ it->second.panel_->setDimensions(getArrowSizeX(dist),getArrowSizeY(dist));
+
// Switch between top, bottom, left and right position of the arrow at the screen border
if ( pos.x < pos.y )
{
@@ -262,6 +288,7 @@
{
//it->second.panel_->setMaterialName ( "Orxonox/NavTDC" );
it->second.panel_->setMaterialName( TextureGenerator::getMaterialName( "tdc.png", it->first->getRadarObjectColour()) );
+ it->second.panel_->setDimensions ( navMarkerSize_ * this->getActualSize().x, navMarkerSize_ * this->getActualSize().y );
it->second.wasOutOfView_ = false;
}
@@ -279,7 +306,7 @@
it->second.panel_->show();
it->second.text_->show();
}
- else // do not display on HUD
+ else
{
it->second.panel_->hide();
it->second.text_->hide();
@@ -311,7 +338,7 @@
void HUDNavigation::addObject ( RadarViewable* object )
{
- if( showObject(object) == false )
+ if( showObject(object)==false )
return;
if ( activeObjectList_.size() >= markerLimit_ )
@@ -398,7 +425,7 @@
if ( rv == dynamic_cast<RadarViewable*> ( this->getOwner() ) )
return false;
assert( rv->getWorldEntity() );
- if ( rv->getWorldEntity()->isVisible() == false || rv->getRadarVisibility() == false )
+ if ( rv->getWorldEntity()->isVisible()==false || rv->getRadarVisibility()==false )
return false;
return true;
}
Modified: code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.h 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/src/modules/overlays/hud/HUDNavigation.h 2011-12-14 15:45:22 UTC (rev 8988)
@@ -23,6 +23,7 @@
* Felix Schulthess
* Co-authors:
* Reto Grieder
+ * Matthias Spalinger
*
*/
@@ -53,6 +54,7 @@
virtual void XMLPort ( Element& xmlelement, XMLPort::Mode mode );
virtual void tick ( float dt );
+ // RadarListener interface
virtual void addObject ( RadarViewable* object );
virtual void removeObject ( RadarViewable* viewable );
virtual void objectChanged ( RadarViewable* viewable );
@@ -66,6 +68,8 @@
inline float getRadarSensitivity() const
{ return 1.0f; }
+ unsigned int getMarkerLimit() { return this->markerLimit_; }
+
private:
struct ObjectInfo
{
@@ -84,10 +88,6 @@
float getNavMarkerSize() const
{ return navMarkerSize_; }
- void setDetectionLimit( float limit )
- { this->detectionLimit_ = limit; }
- float getDetectionLimit() const
- { return this->detectionLimit_; }
void setTextSize ( float size );
float getTextSize() const;
@@ -101,14 +101,17 @@
typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
sortedList sortedObjectList_;
+ float getArrowSizeX(int dist);
+ float getArrowSizeY(int dist);
float navMarkerSize_;
std::string fontName_;
float textSize_;
+ bool showDistance;
- unsigned int markerLimit_; //TODO: is it possible to set this over the console and/or the IG-Setting
- float detectionLimit_; //!< Objects that are more far away than detectionLimit_ are not displayed on the HUD. 10000.0f is the default value.
- //!< In order to bypass this behaviour, set a negative detectionLimit_. Then the detection range is "infinite".
+ unsigned int markerLimit_;;
+
+
};
}
Modified: code/branches/presentation2011/src/orxonox/controllers/NewHumanController.h
===================================================================
--- code/branches/presentation2011/src/orxonox/controllers/NewHumanController.h 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/src/orxonox/controllers/NewHumanController.h 2011-12-14 15:45:22 UTC (rev 8988)
@@ -68,7 +68,10 @@
virtual void doPauseControl();
virtual void doResumeControl();
+ float getCurrentYaw(){ return this->currentYaw_; }
+ float getCurrentPitch(){ return this->currentPitch_; }
+
protected:
void updateTarget();
void alignArrows();
Modified: code/branches/presentation2011/src/orxonox/infos/PlayerInfo.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/infos/PlayerInfo.cc 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/src/orxonox/infos/PlayerInfo.cc 2011-12-14 15:45:22 UTC (rev 8988)
@@ -35,6 +35,7 @@
#include "gametypes/Gametype.h"
#include "worldentities/ControllableEntity.h"
#include "controllers/Controller.h"
+#include "worldentities/pawns/SpaceShip.h"
namespace orxonox
{
@@ -169,6 +170,11 @@
}
this->changedControllableEntity();
+ SpaceShip* spaceship = dynamic_cast<SpaceShip*>(entity);
+ if (spaceship != NULL)
+ {
+ spaceship->setRVName(this->getName());
+ }
}
void PlayerInfo::startTemporaryControl(ControllableEntity* entity)
Modified: code/branches/presentation2011/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/interfaces/RadarViewable.cc 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/src/orxonox/interfaces/RadarViewable.cc 2011-12-14 15:45:22 UTC (rev 8988)
@@ -50,6 +50,7 @@
, radarObjectShape_(Dot)
, radarObjectDescription_("staticObject")
, scale_(1.0f)
+ , RVName("")
{
RegisterRootObject(RadarViewable);
Modified: code/branches/presentation2011/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/branches/presentation2011/src/orxonox/interfaces/RadarViewable.h 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/src/orxonox/interfaces/RadarViewable.h 2011-12-14 15:45:22 UTC (rev 8988)
@@ -60,6 +60,17 @@
RadarViewable(BaseObject* creator, const WorldEntity* wePtr);
virtual ~RadarViewable();
+ virtual void setRVName(std::string name)
+ {
+ if (this->RVName != name)
+ {
+ this->RVName = name;
+ this->settingsChanged();
+ }
+ }
+ std::string getRVName() const
+ { return this->RVName; }
+
inline void setRadarObjectCamouflage(float camouflage)
{
if( this->radarObjectCamouflage_ != camouflage )
@@ -151,6 +162,7 @@
std::string radarObjectDescription_;
ColourValue radarObjectColour_;
float scale_;
+ std::string RVName;
};
}
Modified: code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc 2011-12-14 15:33:22 UTC (rev 8987)
+++ code/branches/presentation2011/src/orxonox/worldentities/pawns/Pawn.cc 2011-12-14 15:45:22 UTC (rev 8988)
@@ -128,8 +128,8 @@
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 );
}
void Pawn::registerVariables()
More information about the Orxonox-commit
mailing list