[Orxonox-commit 2335] r7050 - code/branches/presentation3/src/modules/overlays/hud
sfluecki at orxonox.net
sfluecki at orxonox.net
Mon May 31 15:17:26 CEST 2010
Author: sfluecki
Date: 2010-05-31 15:17:25 +0200 (Mon, 31 May 2010)
New Revision: 7050
Modified:
code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.cc
code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.h
Log:
Added a ConfigValue to limit the amount of marked entities
Modified: code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.cc
===================================================================
--- code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.cc 2010-05-31 13:08:51 UTC (rev 7049)
+++ code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.cc 2010-05-31 13:17:25 UTC (rev 7050)
@@ -45,7 +45,7 @@
#include "controllers/HumanController.h"
#include "worldentities/pawns/Pawn.h"
#include "worldentities/WorldEntity.h"
-#include "interfaces/RadarViewable.h"
+#include "core/ConfigValueIncludes.h"
// #include <boost/bind/bind_template.hpp>
@@ -56,12 +56,19 @@
return a.second<b.second;
}
+
+void HUDNavigation::setConfigValues()
+{
+ SetConfigValue(markerLimit_, 3);
+}
+
CreateFactory ( HUDNavigation );
HUDNavigation::HUDNavigation ( BaseObject* creator )
: OrxonoxOverlay ( creator )
{
RegisterObject ( HUDNavigation );
+ this->setConfigValues();
// Set default values
setFont ( "Monofur" );
@@ -131,6 +138,8 @@
return textSize_;
}
+
+
void HUDNavigation::tick ( float dt )
{
SUPER ( HUDNavigation, tick, dt );
@@ -141,7 +150,6 @@
const Matrix4& camTransform = cam->getOgreCamera()->getProjectionMatrix() * cam->getOgreCamera()->getViewMatrix();
- //TODO: sort list 'sortedObjectList_' according to distance.$
for ( sortedList::iterator listIt = sortedObjectList_.begin(); listIt != sortedObjectList_.end(); ++listIt )
{
listIt->second = ( int ) ( ( listIt->first->getRVWorldPosition() - HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition() ).length() + 0.5f );
@@ -337,7 +345,7 @@
sortedObjectList_.push_front ( std::make_pair ( object, ( unsigned int ) 0 ) );
- //TODO: hide elements
+
}
void HUDNavigation::removeObject ( RadarViewable* viewable )
@@ -379,7 +387,7 @@
void HUDNavigation::changedOwner()
{
- // TODO: Delete old objects?
+
const std::set<RadarViewable*>& respawnObjects = this->getOwner()->getScene()->getRadar()->getRadarObjects();
for ( std::set<RadarViewable*>::const_iterator it = respawnObjects.begin(); it != respawnObjects.end(); ++it )
{
Modified: code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.h
===================================================================
--- code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.h 2010-05-31 13:08:51 UTC (rev 7049)
+++ code/branches/presentation3/src/modules/overlays/hud/HUDNavigation.h 2010-05-31 13:17:25 UTC (rev 7050)
@@ -48,6 +48,8 @@
HUDNavigation ( BaseObject* creator );
virtual ~HUDNavigation();
+ void setConfigValues();
+
virtual void XMLPort ( Element& xmlElement, XMLPort::Mode mode );
virtual void tick ( float dt );
@@ -97,7 +99,7 @@
std::string fontName_;
float textSize_;
- static const unsigned int markerLimit_ = 5; //TODO: is it possible to set this over the console and/or the IG-Setting
+ unsigned int markerLimit_;; //TODO: is it possible to set this over the console and/or the IG-Setting
};
More information about the Orxonox-commit
mailing list