Index: code/branches/Presentation_HS16/src/modules/CMakeLists.txt
===================================================================
--- code/branches/Presentation_HS16/src/modules/CMakeLists.txt	(revision 11347)
+++ code/branches/Presentation_HS16/src/modules/CMakeLists.txt	(revision 11350)
@@ -44,2 +44,3 @@
 ADD_SUBDIRECTORY(dodgerace)
 ADD_SUBDIRECTORY(hover)
+ADD_SUBDIRECTORY(waypoints)
Index: code/branches/Presentation_HS16/src/modules/waypoints/CMakeLists.txt
===================================================================
--- code/branches/Presentation_HS16/src/modules/waypoints/CMakeLists.txt	(revision 11350)
+++ code/branches/Presentation_HS16/src/modules/waypoints/CMakeLists.txt	(revision 11350)
@@ -0,0 +1,17 @@
+ADD_SOURCE_FILES(WAYPOINTS_SRC_FILES
+
+  Waypointarrow.cc
+  Waypoint.cc
+  WaypointGroup.cc
+)
+
+
+ORXONOX_ADD_LIBRARY(waypoints
+  MODULE
+  FIND_HEADER_FILES
+  LINK_LIBRARIES
+    orxonox
+    overlays
+    objects
+  SOURCE_FILES ${WAYPOINTS_SRC_FILES}
+)
Index: code/branches/Presentation_HS16/src/modules/waypoints/Waypoint.cc
===================================================================
--- code/branches/Presentation_HS16/src/modules/waypoints/Waypoint.cc	(revision 11350)
+++ code/branches/Presentation_HS16/src/modules/waypoints/Waypoint.cc	(revision 11350)
@@ -0,0 +1,60 @@
+#include "Waypoint.h"
+#include <OgreSceneNode.h>
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+#include "util/OrxAssert.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+#include "WaypointGroup.h"
+#include "core/EventIncludes.h"
+
+
+namespace orxonox
+
+
+{
+    RegisterClass(Waypoint);
+
+    Waypoint::Waypoint(Context* context) : StaticEntity(context)
+    {
+        RegisterObject(Waypoint);
+        model = new Model(this->getContext());
+        model->setMeshSource("cube.mesh");  // Name of the arrow file for now bottle
+        this->attach(model);
+        model->setScale(0);
+        //model->setOrientation(Vector3(0,0,-1));
+        model->setPosition(Vector3(0.0,0.0,0.0));        // this is wrong, it has to be triggered
+        waypoint_actived = false;
+        distancetrigger = new DistanceTrigger(this->getContext());
+        distancetrigger->setDistance(100);
+        distancetrigger->addTarget("Pawn");
+        distancetrigger->setStayActive(false);
+        this->addEventSource(distancetrigger, "activate");
+        this->attach(distancetrigger);
+    }
+
+    Waypoint::~Waypoint()
+    {
+    }
+
+
+    void Waypoint::activate(){
+        orxout() << "activate function" << endl;
+        ///++order;
+        waypointgroup->activateNext();
+    }
+
+
+     //WorldEntity::setDirection
+     //WorldEntity::getPosition()
+     //setOrientation()
+
+
+    void Waypoint::XMLEventPort(Element& xmlelement, XMLPort::Mode mode){
+        SUPER(Waypoint, XMLEventPort, xmlelement, mode); // From the SpaceShip.cc file
+        //XMLPortParam(Waypoint, "order", setOrder, getOrder, xmlelement, mode);
+        XMLPortEventState(Waypoint, BaseObject, "activate", activate, xmlelement, mode);
+
+    }
+
+
+}
Index: code/branches/Presentation_HS16/src/modules/waypoints/Waypoint.h
===================================================================
--- code/branches/Presentation_HS16/src/modules/waypoints/Waypoint.h	(revision 11350)
+++ code/branches/Presentation_HS16/src/modules/waypoints/Waypoint.h	(revision 11350)
@@ -0,0 +1,77 @@
+
+
+#ifndef _Waypoint_H__
+#define _Waypoint_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Waypointprereqs.h"
+#include "worldentities/StaticEntity.h"
+#include "graphics/Model.h"
+#include "objects/triggers/DistanceTrigger.h"
+
+#include <map>
+#include <string>
+
+#include "util/OgreForwardRefs.h"
+#include "tools/interfaces/Tickable.h"
+#include "WaypointGroup.h"
+
+
+namespace orxonox
+{
+    /**
+    @brief
+        The StaticEntity is the simplest derivative of the @ref orxonox::WorldEntity class. This means all StaticEntity instances also have
+        a position in space, a mass, a scale, a frication, ... because every StaticEntity is a WorldEntity. You can attach StaticEntities to eachother ike @ref orxonox::WorldEntity WorldEntities.
+
+        In contrast to the MobileEntity the StaticEntity cannot move with respect to the parent to which it is attached. That's why
+        it is called StaticEntity. It will keep the same position (always with respect to its parent) forever unless you call the
+        function @see setPosition to changee it.
+
+        A StaticEntity can only have the collisition type WorldEntity::None or WorldEntity::Static. The collsion types WorldEntity::Dynamic and WorldEntity::Kinematic are illegal.
+    */
+
+    class _OrxonoxExport Waypoint : public StaticEntity {
+        
+        public:
+
+            Waypoint(Context* context);
+            virtual ~Waypoint();
+
+
+            virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode) override;
+
+            inline void enable_waypoint(){
+                this->waypoint_actived = true;
+            }
+
+            inline void setOrder(int number){
+                this->order = number;
+            }
+
+            inline int getOrder(){
+                return this->order;
+            }
+
+            inline void setWaypointGroup(WaypointGroup* waypointgroup_){
+                this->waypointgroup = waypointgroup_;
+            }
+
+            void activate();
+
+            
+            bool waypoint_actived;
+
+        private:
+    
+            //virtual bool isCollisionTypeLegal(CollisionType type) const override;
+            Model* model;
+            DistanceTrigger* distancetrigger;
+            unsigned int order = 0;
+            WaypointGroup* waypointgroup;
+
+            // network callbacks
+    };
+}
+
+#endif /* _Waypoint_H__ */
Index: code/branches/Presentation_HS16/src/modules/waypoints/WaypointGroup.cc
===================================================================
--- code/branches/Presentation_HS16/src/modules/waypoints/WaypointGroup.cc	(revision 11350)
+++ code/branches/Presentation_HS16/src/modules/waypoints/WaypointGroup.cc	(revision 11350)
@@ -0,0 +1,106 @@
+#include "Waypoint.h"
+
+#include <OgreSceneNode.h>
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+#include "util/OrxAssert.h"
+#include "WaypointGroup.h"
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+
+namespace orxonox
+{
+    RegisterClass(WaypointGroup);
+
+    WaypointGroup::WaypointGroup(Context* context) : StaticEntity(context)
+    {
+        RegisterObject(WaypointGroup);
+        activeWaypoint = nullptr;
+        current = 0;
+
+        //model = new Model(this->getContext());
+        //model->setMeshSource("cube.mesh");  // Name of the arrow file for now bottle
+        //is->attach(model);
+        //model->setScale(3);
+        //model->setOrientation(Vector3(0,0,-1));
+        //model->setPosition(Vector3(0.0,0.0,0.0));        // this is wrong, it has to be triggered
+        //waypoint_active = false;
+        //distancetrigger = new DistanceTrigger(this->getContext());
+        //distancetrigger->setDistance(100);
+        //this->attach(distancetrigger);
+
+    }
+
+    WaypointGroup::~WaypointGroup()
+    {
+    }
+
+
+     //WorldEntity::setDirection
+     //WorldEntity::getPosition()
+     //setOrientation()
+
+
+
+
+    Waypoint* WaypointGroup::getWaypoint(unsigned int index)
+    {
+        unsigned int i = 0;
+        for (Waypoint* child : this->waypoints_)
+        {
+            if (i == index)
+                return child;
+            ++i;
+        }
+        return nullptr;
+    }
+
+    void WaypointGroup::setWaypoint(Waypoint* object)
+    {
+        object->setWaypointGroup(this);
+        this->waypoints_.insert(object);
+    }
+
+    void WaypointGroup::activateNext(){
+        if (std::next(waypoints_.begin(), current) != std::next(waypoints_.end(), 0)){
+          activeWaypoint = *std::next(waypoints_.begin(), current);
+          ++current;
+        }
+    }
+
+    Waypoint* WaypointGroup::getActive(){
+          if (activeWaypoint == nullptr){
+            orxout() << "Null Pointer" << endl;
+            activateNext();
+
+          }
+          return activeWaypoint;
+    }
+
+//    Waypoint* WaypointGroup::activateNext(){
+//        for (Waypoint* object : this->waypoints_){
+//            if(!(object->waypoint_actived)){
+//                //object->enable_waypoint();
+//                activeWaypoint = object;
+//                break;
+//            }
+//        }
+//        return activeWaypoint;
+//    }
+
+ //   Waypoint* WaypointGroup::getFirst(){
+ //       std::set<Waypoint*>::iterator it = waypoints_.begin();
+ //       return *it;
+ //   }
+
+
+
+    void WaypointGroup::XMLPort(Element& xmlelement, XMLPort::Mode mode){
+        SUPER(WaypointGroup, XMLPort, xmlelement, mode); // From the SpaceShip.cc file
+        XMLPortObject(WaypointGroup, Waypoint, "waypoints", setWaypoint, getWaypoint, xmlelement, mode);
+
+    }
+
+
+
+}
Index: code/branches/Presentation_HS16/src/modules/waypoints/WaypointGroup.h
===================================================================
--- code/branches/Presentation_HS16/src/modules/waypoints/WaypointGroup.h	(revision 11350)
+++ code/branches/Presentation_HS16/src/modules/waypoints/WaypointGroup.h	(revision 11350)
@@ -0,0 +1,73 @@
+
+
+#ifndef _WaypointGroup_H__
+#define _WaypointGroup_H__
+
+#include "OrxonoxPrereqs.h"
+#include "Waypointprereqs.h"
+#include "worldentities/StaticEntity.h"
+#include "graphics/Model.h"
+#include "objects/triggers/DistanceTrigger.h"
+
+#include <map>
+#include <string>
+
+#include "core/CoreIncludes.h"
+#include "util/OgreForwardRefs.h"
+#include "Waypoint.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        The StaticEntity is the simplest derivative of the @ref orxonox::WorldEntity class. This means all StaticEntity instances also have
+        a position in space, a mass, a scale, a frication, ... because every StaticEntity is a WorldEntity. You can attach StaticEntities to eachother ike @ref orxonox::WorldEntity WorldEntities.
+
+        In contrast to the MobileEntity the StaticEntity cannot move with respect to the parent to which it is attached. That's why
+        it is called StaticEntity. It will keep the same position (always with respect to its parent) forever unless you call the
+        function @see setPosition to changee it.
+
+        A StaticEntity can only have the collisition type WorldEntity::None or WorldEntity::Static. The collsion types WorldEntity::Dynamic and WorldEntity::Kinematic are illegal.
+    */
+
+    class _OrxonoxExport WaypointGroup : public StaticEntity {
+
+        public:
+
+            WaypointGroup(Context* context);
+            virtual ~WaypointGroup();
+
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+
+        //Waypoint* getWaypoint();
+        Waypoint* getWaypoint(unsigned int index);
+        void setWaypoint(Waypoint* object);
+
+
+        Waypoint* getActive();
+
+
+        void activateNext();
+
+        //Waypoint* getFirst();
+
+
+
+
+
+
+        private:
+
+            //virtual bool isCollisionTypeLegal(CollisionType type) const override;
+
+        std::set<Waypoint*> waypoints_;
+        Waypoint* activeWaypoint;
+        unsigned int current = 0;
+        //std::set<Waypoint*>::iterator it;
+
+            // network callbacks
+    };
+}
+
+#endif /* _Waypoint_H__ */
Index: code/branches/Presentation_HS16/src/modules/waypoints/Waypointarrow.cc
===================================================================
--- code/branches/Presentation_HS16/src/modules/waypoints/Waypointarrow.cc	(revision 11350)
+++ code/branches/Presentation_HS16/src/modules/waypoints/Waypointarrow.cc	(revision 11350)
@@ -0,0 +1,108 @@
+#include "Waypointarrow.h"
+
+#include "util/Convert.h"
+
+#include <OgreSceneNode.h>
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+#include "util/OrxAssert.h"
+#include "core/CoreIncludes.h"
+#include "core/command/ConsoleCommandIncludes.h"
+
+
+namespace orxonox
+{
+    RegisterClass(Waypointarrow);
+    // SetConsoleCommand("Waypointarrow", "toggleArrow", &Waypointarrow::toggleArrow);
+
+
+    Waypointarrow::Waypointarrow(Context* context) : StaticEntity(context)
+    {
+        RegisterObject(Waypointarrow);
+        model = new Model(this->getContext());
+        model->setMeshSource("arrow.mesh");  // Name of the arrow file for now bottle
+        this->attach(model);
+        model->setScale(3);
+       // model->setOrientation(Vector3(0,0,-1));
+        model->setPosition(Vector3(0,15, 0));
+        waypoints_ = nullptr;
+    }
+
+    Waypointarrow::~Waypointarrow()
+    {
+    }
+
+   /*
+    Waypoint* WaypointGroup::getActive(){
+          for (Waypoint* object : this->waypoints_){
+            if(!(object->waypoint_actived)){
+                object->enable_waypoint();
+                return object;
+            }
+        }
+    }
+
+
+    void tick::getActive
+
+
+*/
+
+ /*   void Waypointarrow::toggleArrow(){
+        if(model->getScale() == 3)
+            model->setScale(0);
+        else
+            model->setScale(3);
+    }
+*/
+
+    WaypointGroup* Waypointarrow::getWaypointgroup()
+    {
+        if (waypoints_ == nullptr){
+
+            for (WaypointGroup* group : ObjectList<WaypointGroup>())
+                waypoints_ = group;
+
+        }
+
+        return waypoints_;
+    }
+
+
+
+
+    void Waypointarrow::tick(float dt){
+
+        if (getWaypointgroup() == nullptr){
+                //orxout() << "Second" << endl;
+
+            return;
+        }
+
+        waypoints_ = getWaypointgroup();
+        waypoint = waypoints_->getActive();
+        Vector3 waypoint_position = waypoint->getWorldPosition();
+
+
+        // orxout() << model->scale_ << endl;
+        //orxout() << "waypoint " << waypoint_position.x <<  "waypoint " << waypoint_position.y << "waypoint " << waypoint_position.z << endl;
+        //orxout() << "model " << this->model->getWorldPosition().x <<  "model " << this->model->getWorldPosition().y << "model " << this->model->getWorldPosition().z << endl;
+        //orxout() << "this " << this->getWorldPosition().x <<  "this " << this->getWorldPosition().y << "this " << this->getWorldPosition().z << endl;
+        //orxout() << "trial " << trial.x <<  "trial " << trial.y << "trial " << trial.z << endl;
+
+
+        Vector3 origin = model->getWorldPosition();;
+        model->setDirection( origin - waypoint_position, TransformSpace::World);
+     
+
+    }
+
+    void Waypointarrow::XMLPort(Element& xmlelement, XMLPort::Mode mode){
+        SUPER(Waypointarrow, XMLPort, xmlelement, mode); // From the SpaceShip.cc file
+        //XMLPortParamTemplate(WorldEntity, "orientation", setOrientation, getOrientation, xmlelement, mode, Vector3)
+        //XMLPortObject(SpaceShip, Engine, "engines", addEngine, getEngine, xmlelement, mode); // TRY ADDING THE WAYPOINT ARROW LIKE AN ENGINE
+
+
+    }
+
+
+}
Index: code/branches/Presentation_HS16/src/modules/waypoints/Waypointarrow.h
===================================================================
--- code/branches/Presentation_HS16/src/modules/waypoints/Waypointarrow.h	(revision 11350)
+++ code/branches/Presentation_HS16/src/modules/waypoints/Waypointarrow.h	(revision 11350)
@@ -0,0 +1,59 @@
+
+
+#ifndef _Waypointarrow_H__
+#define _Waypointarrow_H__
+
+#include "OrxonoxPrereqs.h"
+#include "worldentities/StaticEntity.h"
+#include "graphics/Model.h"
+
+#include <string>
+
+#include "util/OgreForwardRefs.h"
+#include "tools/interfaces/Tickable.h"
+#include "interfaces/RadarListener.h"
+#include "WaypointGroup.h"
+#include "core/XMLPort.h"
+
+
+namespace orxonox
+{
+    /**
+    @brief
+        The StaticEntity is the simplest derivative of the @ref orxonox::WorldEntity class. This means all StaticEntity instances also have
+        a position in space, a mass, a scale, a frication, ... because every StaticEntity is a WorldEntity. You can attach StaticEntities to eachother ike @ref orxonox::WorldEntity WorldEntities.
+
+        In contrast to the MobileEntity the StaticEntity cannot move with respect to the parent to which it is attached. That's why
+        it is called StaticEntity. It will keep the same position (always with respect to its parent) forever unless you call the
+        function @see setPosition to changee it.
+
+        A StaticEntity can only have the collisition type WorldEntity::None or WorldEntity::Static. The collsion types WorldEntity::Dynamic and WorldEntity::Kinematic are illegal.
+    */
+
+    class _OrxonoxExport Waypointarrow : public StaticEntity, public Tickable {
+        
+        public:
+
+            Waypointarrow(Context* context);
+            virtual ~Waypointarrow();
+            WaypointGroup* getWaypointgroup();
+
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode) override;
+
+            virtual void tick(float dt);
+            //static void toogleArrow();
+
+
+
+        private:
+    
+            //virtual bool isCollisionTypeLegal(CollisionType type) const override;
+            Model* model;
+            WaypointGroup* waypoints_;
+            Waypoint* waypoint;
+            // network callbacks
+    };
+}
+
+#endif /* _Waypoint_H__ */
Index: code/branches/Presentation_HS16/src/modules/waypoints/Waypointprereqs.h
===================================================================
--- code/branches/Presentation_HS16/src/modules/waypoints/Waypointprereqs.h	(revision 11350)
+++ code/branches/Presentation_HS16/src/modules/waypoints/Waypointprereqs.h	(revision 11350)
@@ -0,0 +1,55 @@
+/*
+ *   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:
+ *      ...
+ *
+ */
+
+/**
+@file
+@brief
+    Shared library macros, enums, constants and forward declarations for the Waypoint module
+*/
+
+#ifndef _WaypointPrereqs_H__
+#define _WaypointPrereqs_H__
+
+#include "OrxonoxConfig.h"
+#include "OrxonoxPrereqs.h"
+
+
+//-----------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------
+
+namespace orxonox
+{
+    class Waypoint;
+    class WaypointGroup;
+    class Waypointarrow;
+
+    
+}
+
+#endif /* _WaypointPrereqs_H__ */
