[Orxonox-commit 1999] r6716 - in code/branches/hudelements/src/orxonox: controllers gamestates interfaces
scheusso at orxonox.net
scheusso at orxonox.net
Tue Apr 13 14:31:15 CEST 2010
Author: scheusso
Date: 2010-04-13 14:31:14 +0200 (Tue, 13 Apr 2010)
New Revision: 6716
Modified:
code/branches/hudelements/src/orxonox/controllers/HumanController.cc
code/branches/hudelements/src/orxonox/gamestates/GSGraphics.cc
code/branches/hudelements/src/orxonox/interfaces/RadarViewable.cc
code/branches/hudelements/src/orxonox/interfaces/RadarViewable.h
Log:
removed some bindings to map
Modified: code/branches/hudelements/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/branches/hudelements/src/orxonox/controllers/HumanController.cc 2010-04-13 12:14:27 UTC (rev 6715)
+++ code/branches/hudelements/src/orxonox/controllers/HumanController.cc 2010-04-13 12:31:14 UTC (rev 6716)
@@ -34,7 +34,6 @@
#include "worldentities/pawns/Pawn.h"
#include "gametypes/Gametype.h"
#include "infos/PlayerInfo.h"
-#include "overlays/Map.h"
#include "Radar.h"
#include "Scene.h"
@@ -115,24 +114,12 @@
void HumanController::yaw(const Vector2& value)
{
- //Hack to enable mouselook in map
- if ( Map::getSingletonPtr() && Map::getSingletonPtr()->getVisibility() && HumanController::localController_s->controllableEntity_->isInMouseLook() )
- {
- Map::getSingletonPtr()->rotateYaw(value);
- return;
- }
if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
HumanController::localController_s->controllableEntity_->rotateYaw(value);
}
void HumanController::pitch(const Vector2& value)
{
- //Hack to enable mouselook in map
- if ( Map::getSingletonPtr() && Map::getSingletonPtr()->getVisibility() && HumanController::localController_s->controllableEntity_->isInMouseLook() )
- {
- Map::getSingletonPtr()->rotatePitch(value);
- return;
- }
if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
HumanController::localController_s->controllableEntity_->rotatePitch(value);
}
Modified: code/branches/hudelements/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- code/branches/hudelements/src/orxonox/gamestates/GSGraphics.cc 2010-04-13 12:14:27 UTC (rev 6715)
+++ code/branches/hudelements/src/orxonox/gamestates/GSGraphics.cc 2010-04-13 12:31:14 UTC (rev 6716)
@@ -38,8 +38,6 @@
#include "core/ConsoleCommand.h"
#include "core/Game.h"
#include "core/GUIManager.h"
-// HACK:
-#include "overlays/Map.h"
namespace orxonox
{
@@ -72,8 +70,7 @@
*/
void GSGraphics::deactivate()
{
- // HACK: (destroys a resource smart pointer)
- Map::hackDestroyMap();
+
}
void GSGraphics::update(const Clock& time)
Modified: code/branches/hudelements/src/orxonox/interfaces/RadarViewable.cc
===================================================================
--- code/branches/hudelements/src/orxonox/interfaces/RadarViewable.cc 2010-04-13 12:14:27 UTC (rev 6715)
+++ code/branches/hudelements/src/orxonox/interfaces/RadarViewable.cc 2010-04-13 12:31:14 UTC (rev 6716)
@@ -38,7 +38,6 @@
#include "worldentities/WorldEntity.h"
#include "Radar.h"
#include "Scene.h"
-#include "overlays/Map.h"
namespace orxonox
{
@@ -46,11 +45,7 @@
@brief Constructor.
*/
RadarViewable::RadarViewable()
- : MapNode_(NULL)
- , MapEntity_(NULL)
- , line_(NULL)
- , LineNode_(NULL)
- , isHumanShip_(false)
+ : isHumanShip_(false)
, bVisibility_(true)
, radarObjectCamouflage_(0.0f)
, radarObjectShape_(Dot)
@@ -59,79 +54,13 @@
RegisterRootObject(RadarViewable);
this->uniqueId_=getUniqueNumberString();
-/*
- if(Map::getSingletonPtr() && Map::getSingletonPtr()->getMapSceneManagerPtr())
- {
- this->addEntity();
- }
-
- */
}
RadarViewable::~RadarViewable()
{
- if (this->isHumanShip_ && MapNode_)
- MapNode_->removeAllChildren();
-
- if (MapNode_)
- delete MapNode_;
-
- if (MapEntity_)
- delete MapEntity_;
-
- if (line_)
- delete line_;
-
- if (LineNode_)
- delete LineNode_;
}
- void RadarViewable::addMapEntity()
- { //TODO Check shape and add accordantly
- if( this->MapNode_ && !this->MapEntity_ && Map::getSingletonPtr() && Map::getSingletonPtr()->getMapSceneManagerPtr() )
- {
- COUT(0) << "Adding " << this->uniqueId_ << " to Map.\n";
- this->MapEntity_ = Map::getSingletonPtr()->getMapSceneManagerPtr()->createEntity( this->uniqueId_, "drone.mesh");
- /*this->line_ = Map::getSingletonPtr()->getMapSceneManagerPtr()->createManualObject(this->uniqueId_ + "_l");
- this->line_->begin("Map/line_", Ogre::RenderOperation::OT_LINE_STRIP);
- //line_->position(0, -it->getRVWorldPosition().y, 0);
- //this->line_->position(0, -20, 0);
- this->line_->position(0, 0, -10); //Front Arrow
- this->line_->position(0, 0, 0);
-
- this->line_->end(); */
- this->line_ = new Ogre::DynamicLines(Ogre::RenderOperation::OT_LINE_LIST);
- this->line_->addPoint( Vector3(0,0,0) );
- this->line_->addPoint( Vector3(0,0,0) );
-
- this->MapNode_->attachObject( this->MapEntity_ );
-
- this->LineNode_ = this->MapNode_->createChildSceneNode();
- this->LineNode_->attachObject( this->line_ );
- }
- else
- {
- COUT(0) << "Unable to load " << this->uniqueId_ << " to Map.\n";
- }
- }
-
- void RadarViewable::updateMapPosition()
- {
- if( this->MapNode_ )
- {
- this->MapNode_->setPosition( this->getRVWorldPosition() );
- this->MapNode_->translate( this->getRVOrientedVelocity(), static_cast<Ogre::Node::TransformSpace>(3) );
- this->MapNode_->setOrientation( this->getWorldEntity()->getOrientation() );
-//Vector3 v = this->getRVWorldPosition();
- //this->line_->setPoint(1, Vector3(0,v.y,0) );
- this->line_->setPoint(1, Vector3( 0, static_cast<float>(static_cast<int>( -Map::getSingletonPtr()->movablePlane_->getDistance( this->getRVWorldPosition() ) ) ) ,0 ));
- this->line_->update();
- if( Map::getSingletonPtr()->playerShipNode_ )
- this->LineNode_->setDirection( Map::getSingletonPtr()->playerShipNode_->getLocalAxes().GetColumn(1) ,Ogre::Node::TS_WORLD,Vector3::UNIT_Y);
- }
- }
-
void RadarViewable::setRadarObjectDescription(const std::string& str)
{
Radar* radar = this->getWorldEntity()->getScene()->getRadar();
Modified: code/branches/hudelements/src/orxonox/interfaces/RadarViewable.h
===================================================================
--- code/branches/hudelements/src/orxonox/interfaces/RadarViewable.h 2010-04-13 12:14:27 UTC (rev 6715)
+++ code/branches/hudelements/src/orxonox/interfaces/RadarViewable.h 2010-04-13 12:31:14 UTC (rev 6716)
@@ -87,23 +87,7 @@
inline Shape getRadarObjectShape() const
{ return this->radarObjectShape_; }
-/*
- inline void setMapNode(Ogre::SceneNode * node)
- { this->MapNode_ = node; }
- inline Ogre::SceneNode * getMapNode() const
- { return this->MapNode_; }
- inline void setMapEntity(Ogre::Entity * ent)
- { this->MapEntity_ = ent; }
- inline Ogre::Entity * getMapEntity() const
- { return this->MapEntity_; }
-*/
- //Used for Map
- Ogre::SceneNode * MapNode_;
- Ogre::Entity * MapEntity_;
- Ogre::DynamicLines* line_;
- Ogre::SceneNode * LineNode_;
- void addMapEntity();
- void updateMapPosition();
+
bool isHumanShip_;
inline const std::string& getUniqueId()
{
More information about the Orxonox-commit
mailing list