Index: code/trunk/src/orxonox/Radar.cc
===================================================================
--- code/trunk/src/orxonox/Radar.cc	(revision 1815)
+++ 	(revision )
@@ -1,213 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      Felix Schulthess
- *
- */
-
-/**
-    @file
-    @brief
-*/
-
-#include "OrxonoxStableHeaders.h"
-#include "Radar.h"
-#include <cfloat>
-#include <cassert>
-#include "objects/WorldEntity.h"
-#include "objects/SpaceShip.h"
-#include "core/CoreIncludes.h"
-#include "core/ConsoleCommand.h"
-#include "core/Iterator.h"
-#include "RadarListener.h"
-
-namespace orxonox
-{
-    SetConsoleCommand(Radar, cycleNavigationFocus, true).accessLevel(AccessLevel::User);
-    SetConsoleCommand(Radar, releaseNavigationFocus, true).accessLevel(AccessLevel::User);
-
-    Radar* Radar::instance_s = 0;
-
-    Radar::Radar()
-        : focus_(0)
-        , objectTypeCounter_(0)
-    {
-        assert(instance_s == 0);
-        instance_s = this;
-
-        // TODO: make this mapping configurable. Maybe there's a possibility with self configured
-        //       configValues..
-        this->objectTypes_["Asteroid"] = RadarViewable::Dot;
-        this->objectTypes_["SpaceShip"] = RadarViewable::Square;
-        this->objectTypes_["AsdfQwerty"] = RadarViewable::Triangle;
-
-        /*WorldEntity* object;
-        object = new WorldEntity();
-        object->setPosition(2000.0, 0.0, 0.0);
-        addRadarObject(object, ColourValue(0.5, 0, 0, 1));
-        object = new WorldEntity();
-        object->setPosition(0.0, 2000.0, 0.0);
-        addRadarObject(object, ColourValue(0.5, 0, 0, 1));
-        object = new WorldEntity();
-        object->setPosition(0.0, 0.0, 2000.0);
-        addRadarObject(object, ColourValue(0.5, 0, 0, 1));
-        object = new WorldEntity();
-        object->setPosition(10000.0,16000.0,0.0);
-        addRadarObject(object);*/
-
-    }
-
-    Radar::~Radar()
-    {
-        instance_s = 0;
-    }
-
-    const RadarViewable* Radar::getFocus()
-    {
-        return *(this->itFocus_);
-    }
-
-    RadarViewable::Shape Radar::addObjectDescription(const std::string name)
-    {
-        std::map<std::string, RadarViewable::Shape>::iterator it = this->objectTypes_.find(name);
-        if (it == this->objectTypes_.end())
-            return this->objectTypes_[name] = RadarViewable::Square; // default, configure!!
-        else
-            return this->objectTypes_[name];
-    }
-
-
-    void Radar::tick(float dt)
-    {
-        if (this->focus_ != *(this->itFocus_))
-        {
-            // focus object was deleted, release focus
-            this->focus_ = 0;
-            this->itFocus_ = 0;
-        }
-
-        for (ObjectList<RadarListener>::iterator itListener = ObjectList<RadarListener>::begin(); itListener; ++itListener)
-        {
-            (*itListener)->radarTick(dt);
-
-            for (ObjectList<RadarViewable>::iterator itElement = ObjectList<RadarViewable>::begin(); itElement; ++itElement)
-            {
-                if ((*itElement) != SpaceShip::getLocalShip() && (*itListener)->getRadarSensitivity() > (*itElement)->getRadarObjectCamouflage())
-                    (*itListener)->displayObject(*itElement, *itElement == this->focus_);
-            }
-        }
-    }
-
-    void Radar::cycleFocus()
-    {
-        if (ObjectList<RadarViewable>::begin() == 0)
-        {
-            // list is empty
-            this->itFocus_ = 0;
-            this->focus_ = 0;
-        }
-        else
-        {
-            Vector3 localPosition = SpaceShip::getLocalShip()->getPosition();
-            Vector3 targetPosition = localPosition;
-            if (*(this->itFocus_))
-                targetPosition = this->itFocus_->getWorldPosition();
-
-            // find the closed object further away than targetPosition
-            float currentDistance = localPosition.squaredDistance(targetPosition);
-            float nextDistance = FLT_MAX;
-            float minimumDistance = FLT_MAX;
-            ObjectList<RadarViewable>::iterator itFallback = 0;
-
-            for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it)
-            {
-                if (*it == SpaceShip::getLocalShip())
-                    continue;
-
-                float targetDistance = localPosition.squaredDistance((*it)->getWorldPosition());
-                if (targetDistance > currentDistance && targetDistance < nextDistance)
-                {
-                    this->itFocus_ = it;
-                    nextDistance = targetDistance;
-                }
-                if (targetDistance < minimumDistance)
-                {
-                    itFallback = it;
-                    minimumDistance = targetDistance;
-                }
-            }
-
-            if (nextDistance == FLT_MAX)
-            {
-                // we already had the furthest object
-                this->itFocus_ = itFallback;
-                this->focus_ = *itFallback;
-            }
-            else
-            {
-                this->focus_ = *(this->itFocus_);
-            }
-        }
-    }
-
-    void Radar::releaseFocus()
-    {
-        this->itFocus_ = 0;
-        this->focus_ = 0;
-    }
-
-    void Radar::listObjects() const
-    {
-        COUT(3) << "List of RadarObjects:\n";
-        // iterate through all Radar Objects
-        unsigned int i = 0;
-        for (ObjectList<RadarViewable>::iterator it = ObjectList<RadarViewable>::begin(); it; ++it, ++i)
-        {
-            COUT(3) << i++ << ": " << (*it)->getWorldPosition() << std::endl;
-        }
-    }
-
-
-    /*static*/ Radar& Radar::getInstance()
-    {
-        assert(instance_s);
-        return *instance_s;
-    }
-
-    /*static*/ void Radar::cycleNavigationFocus()
-    {
-        // avoid using getInstance because of the assert().
-        // User might call this fuction even if HUDNavigation doesn't exist.
-        if (instance_s)
-            instance_s->cycleFocus();
-    }
-
-    /*static*/ void Radar::releaseNavigationFocus()
-    {
-        // avoid using getInstance because of the assert().
-        // User might call this fuction even if HUDNavigation doesn't exist.
-        if (instance_s)
-            instance_s->releaseFocus();
-    }
-}
Index: code/trunk/src/orxonox/Radar.h
===================================================================
--- code/trunk/src/orxonox/Radar.h	(revision 1815)
+++ 	(revision )
@@ -1,92 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      Felix Schulthess
- *
- */
-
-/**
-    @file
-    @brief
-*/
-
-#ifndef _Radar_H__
-#define _Radar_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include <map>
-#include <string>
-#include "core/Iterator.h"
-#include "core/OrxonoxClass.h"
-#include "objects/Tickable.h"
-#include "RadarViewable.h"
-
-namespace orxonox
-{
-    /**
-    @brief This class merely ensures that no one can inherit from Radar.
-    */
-    class _OrxonoxExport RadarBase
-    {
-    private:
-        friend class Radar;
-        RadarBase() { }
-    };
-
-    class _OrxonoxExport Radar : public Tickable, private virtual RadarBase
-    {
-    public:
-        Radar();
-        ~Radar();
-
-        virtual void tick(float dt);
-
-        const RadarViewable* getFocus();
-        RadarViewable::Shape addObjectDescription(const std::string name);
-
-        void listObjects() const;
-
-        static Radar& getInstance();
-        static Radar* getInstancePtr() { return instance_s; }
-
-        static void cycleNavigationFocus();
-        static void releaseNavigationFocus();
-
-    private:
-        Radar(Radar& instance);
-
-        void releaseFocus();
-        void updateFocus();
-        void cycleFocus();
-
-        ObjectListIterator<RadarViewable> itFocus_;
-        RadarViewable* focus_;
-        std::map<std::string, RadarViewable::Shape> objectTypes_;
-        int objectTypeCounter_;
-
-        static Radar* instance_s;
-    };
-}
-#endif /* _Radar_H__ */
Index: code/trunk/src/orxonox/RadarListener.cc
===================================================================
--- code/trunk/src/orxonox/RadarListener.cc	(revision 1815)
+++ 	(revision )
@@ -1,39 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "RadarListener.h"
-#include "core/CoreIncludes.h"
-
-namespace orxonox
-{
-    RadarListener::RadarListener()
-    {
-        RegisterRootObject(RadarListener);
-    }
-}
Index: code/trunk/src/orxonox/RadarListener.h
===================================================================
--- code/trunk/src/orxonox/RadarListener.h	(revision 1815)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _RadarListener_H__
-#define _RadarListener_H__
-
-#include "OrxonoxPrereqs.h"
-#include "core/OrxonoxClass.h"
-
-namespace orxonox
-{
-    class _OrxonoxExport RadarListener : virtual public OrxonoxClass
-    {
-    public:
-        RadarListener();
-        virtual ~RadarListener() { }
-
-        virtual void displayObject(RadarViewable* viewable, bool bIsMarked) = 0;
-        virtual float getRadarSensitivity() const = 0;
-        virtual void radarTick(float dt) = 0;
-    };
-}
-
-#endif /* _RadarListener_H__ */
Index: code/trunk/src/orxonox/RadarViewable.cc
===================================================================
--- code/trunk/src/orxonox/RadarViewable.cc	(revision 1815)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#include "OrxonoxStableHeaders.h"
-#include "RadarViewable.h"
-#include "util/Debug.h"
-#include "core/CoreIncludes.h"
-#include "objects/WorldEntity.h"
-#include "Radar.h"
-
-namespace orxonox
-{
-    /**
-        @brief Constructor.
-    */
-    RadarViewable::RadarViewable()
-        : radarObject_(0)
-        , radarObjectCamouflage_(0.0f)
-        , radarObjectType_(Dot)
-        , radarObjectDescription_("staticObject")
-    {
-        RegisterRootObject(RadarViewable);
-    }
-
-    void RadarViewable::setRadarObjectDescription(const std::string& str)
-    {
-        Radar* radar = Radar::getInstancePtr();
-        if (radar)
-            this->radarObjectType_ = radar->addObjectDescription(str);
-        else
-        {
-            CCOUT(2) << "Attempting to access the radar, but the radar is non existent." << std::endl;
-        }
-        this->radarObjectDescription_ = str;
-    }
-
-    const Vector3& RadarViewable::getWorldPosition() const
-    {
-        validate();
-        return this->radarObject_->getWorldPosition();
-    }
-
-    Vector3 RadarViewable::getOrientedVelocity() const
-    {
-        validate();
-        return this->radarObject_->getOrientation() * this->radarObject_->getVelocity();
-    }
-}
Index: code/trunk/src/orxonox/RadarViewable.h
===================================================================
--- code/trunk/src/orxonox/RadarViewable.h	(revision 1815)
+++ 	(revision )
@@ -1,87 +1,0 @@
-/*
- *   ORXONOX - the hottest 3D action shooter ever to exist
- *                    > www.orxonox.net <
- *
- *
- *   License notice:
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation; either version 2
- *   of the License, or (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- *
- *   Author:
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
-
-#ifndef _RadarViewable_H__
-#define _RadarViewable_H__
-
-#include "OrxonoxPrereqs.h"
-#include <string>
-#include <cassert>
-#include "util/Math.h"
-#include "util/Debug.h"
-#include "core/OrxonoxClass.h"
-
-namespace orxonox
-{
-    /**
-    @brief Interface for receiving window events.
-    */
-    class _OrxonoxExport RadarViewable : virtual public OrxonoxClass
-    {
-    public:
-        enum Shape
-        {
-            Square,
-            Dot,
-            Triangle
-        };
-
-    public:
-        RadarViewable();
-        virtual ~RadarViewable() { }
-
-        float getRadarObjectCamouflage() const { return this->radarObjectCamouflage_; }
-        void setRadarObjectCamouflage(float camouflage) { this->radarObjectCamouflage_ = camouflage; }
-
-        const ColourValue& getRadarObjectColour() const { return this->radarObjectColour_; }
-        void setRadarObjectColour(const ColourValue& colour) { this->radarObjectColour_ = colour; }
-
-        const std::string& getRadarObjectDescription() const { return this->radarObjectDescription_; }
-        void setRadarObjectDescription(const std::string& str);
-
-        const WorldEntity* getWorldEntity() const { return this->radarObject_; }
-        const Vector3& getWorldPosition() const;
-        Vector3 getOrientedVelocity() const;
-
-        Shape getRadarObjectType() const { return this->radarObjectType_; }
-
-    protected:
-        WorldEntity* radarObject_;
-
-    private:
-        void validate() const { if (!this->radarObject_)
-        { COUT(1) << "Assertation: Every RadarViewable has to be assigned a WorldEntity pointer!" << std::endl; assert(0); } }
-
-        float radarObjectCamouflage_;
-        Shape radarObjectType_;
-        std::string radarObjectDescription_;
-        ColourValue radarObjectColour_;
-    };
-}
-
-#endif /* _RadarViewable_H__ */
