Index: /code/branches/QuestGuide_HS16/src/orxonox/worldentities/Waypoint.cc
===================================================================
--- /code/branches/QuestGuide_HS16/src/orxonox/worldentities/Waypoint.cc	(revision 11236)
+++ /code/branches/QuestGuide_HS16/src/orxonox/worldentities/Waypoint.cc	(revision 11237)
@@ -1,31 +1,2 @@
-/*
- *   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:
- *      Fabian 'x3n' Landau
- *      Reto Grieder (physics)
- *   Co-authors:
- *      ...
- *
- */
-
 #include "Waypoint.h"
 
@@ -52,28 +23,26 @@
     }
 
+
+    void Waypoint::XMLPort(Element& xmlelement, XMLPort::Mode mode){
+        SUPER(Waypoint, XMLPort, xmlelement, mode); // From the SpaceShip.cc file
+
+
+        //XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode); // TRY ADDING THE WAYPOINT ARROW LIKE AN ENGINE
+ 
+
+    }
+
+
+
     void Waypoint::registerVariables()
     {
         // Ugly const casts, but are valid because position and orientation are not actually const
-        registerVariable(const_cast<Vector3&>(this->getPosition()),    VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged));
-        registerVariable(const_cast<Quaternion&>(this->getOrientation()), VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged));
+        registerVariable(const_cast<Vector3&>(this->getPosition()), \
+            VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::positionChanged));
+        registerVariable(const_cast<Quaternion&>(this->getOrientation()),
+            VariableDirection::ToClient, new NetworkCallback<StaticEntity>(this, &StaticEntity::orientationChanged));
     }
 
 
-    void Waypoint::setPosition(const Vector3& position)
-    {
-        if (this->addedToPhysicalWorld())
-        {
-            orxout(internal_warning) << "Attempting to change the position of a StaticEntity at physics run time. Ignoring change." << endl;
-            return;
-        }
-        if (this->isStatic())
-        {
-            btTransform transf = this->physicalBody_->getWorldTransform();
-            transf.setOrigin(btVector3(position.x, position.y, position.z));
-            this->physicalBody_->setWorldTransform(transf);
-        }
-
-        this->node_->setPosition(position);
-    }
 
     void Waypoint::setOrientation(const Quaternion& orientation)
@@ -92,5 +61,16 @@
 
         this->node_->setOrientation(orientation);
+  
     }
+
+    Vector3 Waypoint::toAimPosition(RadarViewable* target) const
+    {
+        Vector3 wePosition = HumanController::getLocalControllerSingleton()->getControllableEntity()->getWorldPosition();
+        Vector3 targetPosition = target->getRVWorldPosition();
+        Vector3 targetSpeed = target->getRVVelocity();
+
+        return getPredictedPosition(wePosition, this->currentMunitionSpeed_, targetPosition, targetSpeed);
+    }
+
 /*
     bool StaticEntity::isCollisionTypeLegal(WorldEntity::CollisionType type) const
@@ -117,2 +97,8 @@
     }
 }
+
+
+const Pawn* pawnPtr = orxonox_cast<const Pawn*>(it->first->getWorldEntity());
+
+if (pawnPtr) {
+   float position = pawnPtr->getPosition();
Index: /code/branches/QuestGuide_HS16/src/orxonox/worldentities/Waypoint.h
===================================================================
--- /code/branches/QuestGuide_HS16/src/orxonox/worldentities/Waypoint.h	(revision 11236)
+++ /code/branches/QuestGuide_HS16/src/orxonox/worldentities/Waypoint.h	(revision 11237)
@@ -1,30 +1,3 @@
-/*
- *   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:
- *      Fabian 'x3n' Landau
- *      Reto Grieder
- *   Co-authors:
- *      ...
- *
- */
+
 
 #ifndef _Waypoint_H__
@@ -33,4 +6,13 @@
 #include "OrxonoxPrereqs.h"
 #include "StaticEntity.h"
+#include "overlays/OverlaysPrereqs.h"
+
+#include <map>
+#include <string>
+
+#include "util/OgreForwardRefs.h"
+#include "tools/interfaces/Tickable.h"
+#include "interfaces/RadarListener.h"
+#include "overlays/OrxonoxOverlay.h"
 
 namespace orxonox
@@ -48,9 +30,13 @@
     */
 
-    class _OrxonoxExport Waypoint : public StaticEntity
+    class _OrxonoxExport Waypoint : public StaticEntity, public RadarListener
     {
         public:
             Waypoint(Context* context);
             virtual ~Waypoint();
+
+            virtual void addObject(RadarViewable* object) override;
+            virtual void removeObject(RadarViewable* viewable) override;
+            virtual void objectChanged(RadarViewable* viewable) override;
 
             using StaticEntity::setPosition;
@@ -59,4 +45,18 @@
             virtual void setPosition(const Vector3& position) override;
             virtual void setOrientation(const Quaternion& orientation) override;
+
+            virtual void positionChanged() override { }
+            virtual void radarTick(float dt) override {}
+
+            virtual inline float getRadarSensitivity() const override
+                { return 1.0f; }
+
+            inline unsigned int getMarkerLimit() const
+                { return this->markerLimit_; }
+
+            static void selectClosestTarget();
+            static void selectNextTarget();
+
+
 
         private:
