Index: code/branches/presentation3/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/presentation3/src/orxonox/OrxonoxPrereqs.h	(revision 7031)
+++ code/branches/presentation3/src/orxonox/OrxonoxPrereqs.h	(revision 7034)
@@ -82,4 +82,5 @@
     class ArtificialController;
     class Controller;
+    class DroneController;
     class HumanController;
     class ScriptController;
@@ -162,4 +163,5 @@
     class CameraPosition;
     class ControllableEntity;
+    class Drone;
     class EffectContainer;
     class ExplosionChunk;
Index: code/branches/presentation3/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/AIController.cc	(revision 7031)
+++ code/branches/presentation3/src/orxonox/controllers/AIController.cc	(revision 7034)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Dominik Solenicki
  *
  */
@@ -56,43 +56,152 @@
         float maxrand = 100.0f / ACTION_INTERVAL;
 
-        // search enemy
-        random = rnd(maxrand);
-        if (random < 15 && (!this->target_))
-            this->searchNewTarget();
-
-        // forget enemy
-        random = rnd(maxrand);
-        if (random < 5 && (this->target_))
-            this->forgetTarget();
-
-        // next enemy
-        random = rnd(maxrand);
-        if (random < 10 && (this->target_))
-            this->searchNewTarget();
-
-        // fly somewhere
-        random = rnd(maxrand);
-        if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
-            this->searchRandomTargetPosition();
-
-        // stop flying
-        random = rnd(maxrand);
-        if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
-            this->bHasTargetPosition_ = false;
-
-        // fly somewhere else
-        random = rnd(maxrand);
-        if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
-            this->searchRandomTargetPosition();
-
-        // shoot
-        random = rnd(maxrand);
-        if (random < 75 && (this->target_ && !this->bShooting_))
-            this->bShooting_ = true;
-
-        // stop shooting
-        random = rnd(maxrand);
-        if (random < 25 && (this->bShooting_))
-            this->bShooting_ = false;
+        if (this->state_ == FREE)
+        {
+
+            if (this->formationFlight_)
+            {
+                // return to Master after being forced free
+                if (this->freedomCount_ == 1)
+                {
+                this->state_ = SLAVE;
+                this->freedomCount_ = 0;
+                }
+
+                random = rnd(maxrand);
+                if (random < 90 && (((!this->target_) || (random < 50 && this->target_)) && !this->forcedFree()))
+                    this->searchNewMaster();
+            }
+
+            // search enemy
+            random = rnd(maxrand);
+            if (random < 15 && (!this->target_))
+                this->searchNewTarget();
+
+            // forget enemy
+            random = rnd(maxrand);
+            if (random < 5 && (this->target_))
+                this->forgetTarget();
+
+            // next enemy
+            random = rnd(maxrand);
+            if (random < 10 && (this->target_))
+                this->searchNewTarget();
+
+            // fly somewhere
+            random = rnd(maxrand);
+            if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
+                this->searchRandomTargetPosition();
+
+            // stop flying
+            random = rnd(maxrand);
+            if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
+                this->bHasTargetPosition_ = false;
+
+            // fly somewhere else
+            random = rnd(maxrand);
+            if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
+                this->searchRandomTargetPosition();
+
+            // shoot
+            random = rnd(maxrand);
+            if (!(this->passive_) && random < 75 && (this->target_ && !this->bShooting_))
+                this->bShooting_ = true;
+
+            // stop shooting
+            random = rnd(maxrand);
+            if (random < 25 && (this->bShooting_))
+                this->bShooting_ = false; 
+
+        }
+
+        if (this->state_ == SLAVE)
+        {
+
+        }
+
+        if (this->state_ == MASTER)
+        {
+
+
+            this->commandSlaves();
+
+            if  (this->specificMasterAction_ != NONE) 
+            {
+                    this->specificMasterActionHold();
+
+//                 if (this->specificMasterAction_  == TURN180)
+//                     this->turn180Init();
+
+//                 if (this->specificMasterAction_ == SPIN)
+//                     this->spinInit();
+
+//                 if (this->specificMasterAction_ == FOLLOWHUMAN)
+//                     this->followHuman(this->HumanToFollow_, false);
+            }
+
+            else {
+
+                 // make 180 degree turn - a specific Master Action
+                random = rnd(1000.0f);
+                if (random < 5)
+                   this->turn180Init();
+
+                // spin around - a specific Master Action
+                random = rnd(1000.0f);
+                if (random < 5)
+                   this->spinInit();
+
+                 // lose master status (only if less than 4 slaves in formation)
+                random = rnd(maxrand);
+                if(random < 15/(this->slaves_.size()+1) && this->slaves_.size() < 4 ) 
+                   this->loseMasterState();
+
+                // look out for outher masters if formation is small
+                random = rnd(maxrand);
+                if(this->slaves_.size() < 3 && random < 20)
+                    this->searchNewMaster();
+
+                // search enemy
+                random = rnd(maxrand);
+                if (random < 15 && (!this->target_))
+                    this->searchNewTarget();
+
+                // forget enemy
+                random = rnd(maxrand);
+                if (random < 5 && (this->target_))
+                    this->forgetTarget();
+
+                // next enemy
+                random = rnd(maxrand);
+                if (random < 10 && (this->target_))
+                    this->searchNewTarget();
+
+                // fly somewhere
+                random = rnd(maxrand);
+                if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
+                    this->searchRandomTargetPosition();
+
+
+                // fly somewhere else
+                random = rnd(maxrand);
+                if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
+                    this->searchRandomTargetPosition();
+
+                // shoot
+                random = rnd(maxrand);
+                if (!(this->passive_) && random < 9 && (this->target_ && !this->bShooting_))
+                {
+                this->bShooting_ = true;
+                this->forceFreeSlaves();
+                }
+
+                // stop shooting
+                random = rnd(maxrand);
+                if (random < 25 && (this->bShooting_))
+                    this->bShooting_ = false;
+
+            }
+        }
+
     }
 
@@ -102,12 +211,46 @@
             return;
 
-        if (this->target_)
-            this->aimAtTarget();
-
-        if (this->bHasTargetPosition_)
-            this->moveToTargetPosition();
-
-        if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
-            this->getControllableEntity()->fire(0);
+        if (this->state_ == MASTER)
+        {
+            if (this->specificMasterAction_ ==  NONE)
+            {
+                if (this->target_)
+                    this->aimAtTarget();
+
+                if (this->bHasTargetPosition_)
+                    this->moveToTargetPosition();
+
+                if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
+                    this->getControllableEntity()->fire(0);
+            }
+
+            if (this->specificMasterAction_  == TURN180)
+                    this->turn180();
+
+            if (this->specificMasterAction_ == SPIN)
+                    this->spin();
+            if (this->specificMasterAction_ == FOLLOWHUMAN)
+                    this->follow();
+        }
+
+        if (this->state_ == SLAVE)
+        {
+
+            if (this->bHasTargetPosition_)
+                this->moveToTargetPosition();
+
+        }
+
+         if (this->state_ == FREE)
+        {
+            if (this->target_)
+                this->aimAtTarget();
+
+            if (this->bHasTargetPosition_)
+                this->moveToTargetPosition();
+
+            if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
+                this->getControllableEntity()->fire(0);
+        }
 
         SUPER(AIController, tick, dt);
Index: code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc	(revision 7031)
+++ code/branches/presentation3/src/orxonox/controllers/ArtificialController.cc	(revision 7034)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Dominik Solenicki
  *
  */
@@ -29,5 +29,7 @@
 #include "ArtificialController.h"
 
+#include <vector>
 #include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
 #include "worldentities/ControllableEntity.h"
 #include "worldentities/pawns/Pawn.h"
@@ -36,7 +38,27 @@
 #include "gametypes/Dynamicmatch.h"
 #include "controllers/WaypointPatrolController.h"
+#include "controllers/NewHumanController.h"
+#include "controllers/DroneController.h"
+#include "util/Math.h"
+#include "core/ConsoleCommand.h"
 
 namespace orxonox
 {
+    SetConsoleCommand(ArtificialController, formationflight, true);
+    SetConsoleCommand(ArtificialController, masteraction, true);
+    SetConsoleCommand(ArtificialController, followme, true);
+    SetConsoleCommand(ArtificialController, passivebehaviour, true);
+    SetConsoleCommand(ArtificialController, formationsize, true);
+
+    static const unsigned int STANDARD_MAX_FORMATION_SIZE = 7;
+    static const int FORMATION_LENGTH =  130;
+    static const int FORMATION_WIDTH =  110;
+    static const int FREEDOM_COUNT = 4; //seconds the slaves in a formation will be set free when master attacks an enemy
+    static const float SPEED_MASTER = 0.6f;
+    static const float ROTATEFACTOR_MASTER = 0.2f;
+    static const float SPEED_FREE = 0.8f;
+    static const float ROTATEFACTOR_FREE = 0.8f;
+    static const int SECONDS_TO_FOLLOW_HUMAN = 100;
+
     ArtificialController::ArtificialController(BaseObject* creator) : Controller(creator)
     {
@@ -44,7 +66,17 @@
 
         this->target_ = 0;
+        this->formationFlight_ = true;
+        this->passive_ = false;
+        this->maxFormationSize_ = STANDARD_MAX_FORMATION_SIZE;
+        this->myMaster_ = 0;
+        this->freedomCount_ = 0;
+	this->team_ = -1;
+	this->state_ = FREE;
+        this->specificMasterAction_ = NONE;
+        this->specificMasterActionHoldCount_  = 0;
         this->bShooting_ = false;
         this->bHasTargetPosition_ = false;
         this->targetPosition_ = Vector3::ZERO;
+        this->humanToFollow_ = NULL;
 
         this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
@@ -54,4 +86,165 @@
     {
     }
+
+    void ArtificialController::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(ArtificialController, XMLPort, xmlelement, mode);
+
+        XMLPortParam(ArtificialController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(-1);
+        XMLPortParam(ArtificialController, "formationflight", setFormationFlight, getFormationFlight, xmlelement, mode).defaultValues(true);
+        XMLPortParam(ArtificialController, "formation_size", setFormationSize, getFormationSize, xmlelement, mode).defaultValues(STANDARD_MAX_FORMATION_SIZE);
+    }
+
+// Documentation only here to get a faster overview for creating a useful documentation...
+
+    /**
+        @brief Activates / deactivates formationflight behaviour
+        @param form activate formflight if form is true
+    */
+    void ArtificialController::formationflight(bool form)
+    {
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            if (!it->getController())
+                continue;
+
+            ArtificialController *aiController = orxonox_cast<ArtificialController*>(it->getController());
+
+            if(aiController)
+            {
+                aiController->formationFlight_ = form;
+                if(!form)
+                {
+                    if(aiController->state_ == MASTER) aiController->freeSlaves();
+                    aiController->state_ = FREE;
+                }
+            }
+        }
+    }
+
+    /**
+        @brief Get all masters to do a "specific master action" 
+        @param action which action to perform (integer, so it can be called with a console command (tmp solution))
+    */
+    void ArtificialController::masteraction(int action)
+    {
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            if (!it->getController())
+                continue;
+
+            ArtificialController *aiController = orxonox_cast<ArtificialController*>(it->getController());
+
+            if(aiController && aiController->state_ == MASTER)
+            {
+                if (action == 1)
+                    aiController->spinInit();
+                if (action == 2)
+                    aiController->turn180Init();
+            }
+        }
+    }
+
+    /**
+        @brief A human player gets followed by its nearest master. Initiated by console command, intended for demonstration puproses. Does not work at the moment.
+    */
+    void ArtificialController::followme()
+    {
+
+        Pawn *humanPawn = NULL;
+        NewHumanController *currentHumanController = NULL;
+        std::vector<ArtificialController*> allMasters;
+
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            if (!it->getController())
+                continue;
+
+            currentHumanController = orxonox_cast<NewHumanController*>(it->getController());
+
+            if(currentHumanController) humanPawn = *it;
+
+            ArtificialController *aiController = orxonox_cast<ArtificialController*>(it->getController());
+
+            if(aiController || aiController->state_ == MASTER)
+                allMasters.push_back(aiController);
+
+        }
+
+        if((humanPawn != NULL) && (allMasters.size() != 0))
+        {
+                float posHuman = humanPawn->getPosition().length();
+                float distance = 0.0f;
+                float minDistance = FLT_MAX;
+                int index = 0;
+                int i = 0;
+
+                for(std::vector<ArtificialController*>::iterator it = allMasters.begin(); it != allMasters.end(); it++)
+                    {
+                        distance = posHuman - (*it)->getControllableEntity()->getPosition().length();
+                        if(distance < minDistance) index = i;
+                    }
+                allMasters[index]->humanToFollow_ = humanPawn;
+//                allMasters[index]->followHuman(humanPawn, false);
+            }
+
+    }
+
+    /**
+        @brief Sets shooting behaviour of pawns.
+        @param passive if true, bots won't shoot.
+    */
+    void ArtificialController::passivebehaviour(bool passive)
+    {
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            if (!it->getController())
+                continue;
+
+            ArtificialController *aiController = orxonox_cast<ArtificialController*>(it->getController());
+
+            if(aiController)
+            {
+                aiController->passive_ = passive;
+            }
+        }
+    }
+
+
+    /**
+        @brief Sets maximal formation size
+        @param size maximal formation size.
+    */
+    void ArtificialController::formationsize(int size)
+    {
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+            if (!it->getController())
+                continue;
+
+            ArtificialController *aiController = orxonox_cast<ArtificialController*>(it->getController());
+
+            if(aiController)
+            {
+                aiController->maxFormationSize_ = size;
+            }
+        }
+    }
+
+    /**
+        @brief Gets called when ControllableEntity is being changed. Resets the bot when it dies.
+    */
+    void ArtificialController::changedControllableEntity()
+    {
+        if(!getControllableEntity()) 
+        {
+        if (this->state_ == SLAVE) unregisterSlave();
+         if (this->state_ == MASTER) setNewMasterWithinFormation();
+        this->slaves_.clear();
+        this->state_ = FREE;
+
+        }
+    }
+
 
     void ArtificialController::moveToPosition(const Vector3& target)
@@ -63,15 +256,55 @@
         float distance = (target - this->getControllableEntity()->getPosition()).length();
 
-        if (this->target_ || distance > 10)
-        {
-            // Multiply with 0.8 to make them a bit slower
-            this->getControllableEntity()->rotateYaw(-0.8f * sgn(coord.x) * coord.x*coord.x);
-            this->getControllableEntity()->rotatePitch(0.8f * sgn(coord.y) * coord.y*coord.y);
-        }
-
-        if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
-            this->getControllableEntity()->moveFrontBack(-0.5f); // They don't brake with full power to give the player a chance
-        else
-            this->getControllableEntity()->moveFrontBack(0.8f);
+
+        if(this->state_ == FREE)
+        {
+            if (this->target_ || distance > 10)
+            {
+                // Multiply with 0.8 to make them a bit slower
+                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_FREE * sgn(coord.x) * coord.x*coord.x);
+                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_FREE * sgn(coord.y) * coord.y*coord.y);
+            }
+
+            if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+            {
+              this->getControllableEntity()->moveFrontBack(-0.05f); // They don't brake with full power to give the player a chance
+            } else this->getControllableEntity()->moveFrontBack(SPEED_FREE);
+        }
+
+
+
+        if(this->state_ == MASTER)
+        {
+            if (this->target_ || distance > 10)
+            {
+                this->getControllableEntity()->rotateYaw(-1.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
+                this->getControllableEntity()->rotatePitch(ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+            }
+
+            if (this->target_ && distance < 200 && this->getControllableEntity()->getVelocity().squaredLength() > this->target_->getVelocity().squaredLength())
+            {
+                this->getControllableEntity()->moveFrontBack(-0.05f);
+            } else this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
+        }
+
+
+
+        if(this->state_ == SLAVE)
+        {
+
+           this->getControllableEntity()->rotateYaw(-2.0f * ROTATEFACTOR_MASTER * sgn(coord.x) * coord.x*coord.x);
+           this->getControllableEntity()->rotatePitch(2.0f * ROTATEFACTOR_MASTER * sgn(coord.y) * coord.y*coord.y);
+
+            if (distance < 300)
+            {
+                if (distance < 40)
+                {
+                    this->getControllableEntity()->moveFrontBack(0.8f*SPEED_MASTER);
+                } else this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER);
+
+            } else {
+                this->getControllableEntity()->moveFrontBack(1.2f*SPEED_MASTER + distance/300.0f);
+            }
+        }
     }
 
@@ -80,4 +313,302 @@
         this->moveToPosition(this->targetPosition_);
     }
+
+    int ArtificialController::getState()
+    {
+        return this->state_;
+    }
+
+    /**
+        @brief Unregisters a slave from its master. Called by a slave.
+    */
+    void ArtificialController::unregisterSlave() {
+        if(myMaster_)
+        {
+            std::vector<ArtificialController*>::iterator it = std::find(myMaster_->slaves_.begin(), myMaster_->slaves_.end(), this);
+            if( it != myMaster_->slaves_.end() )
+                myMaster_->slaves_.erase(it);
+        }
+    }
+
+    void ArtificialController::searchNewMaster()
+    {
+
+        if (!this->getControllableEntity())
+            return;
+
+        this->targetPosition_ = this->getControllableEntity()->getPosition();
+        this->forgetTarget();
+        int teamSize = 0;
+        //go through all pawns
+        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it; ++it)
+        {
+
+            //same team?
+            if (!ArtificialController::sameTeam(this->getControllableEntity(), static_cast<ControllableEntity*>(*it), this->getGametype()))
+                continue;
+
+            //has it an ArtificialController?
+            if (!it->getController())
+                continue;
+
+            //is pawn oneself?
+            if (orxonox_cast<ControllableEntity*>(*it) == this->getControllableEntity())
+                continue;
+
+            teamSize++;
+
+            ArtificialController *newMaster = orxonox_cast<ArtificialController*>(it->getController());
+
+            //is it a master?
+            if (!newMaster || newMaster->getState() != MASTER)
+                continue;
+
+            float distance = (it->getPosition() - this->getControllableEntity()->getPosition()).length();
+
+            // is pawn in range?
+            if (distance < 5000)
+            {
+                if(newMaster->slaves_.size() > this->maxFormationSize_) continue;
+
+                for(std::vector<ArtificialController*>::iterator itSlave = this->slaves_.begin(); itSlave != this->slaves_.end(); itSlave++)
+                {
+                    (*itSlave)->myMaster_ = newMaster;
+                    newMaster->slaves_.push_back(*itSlave);
+                }
+                this->slaves_.clear();
+                this->state_ = SLAVE;
+
+                this->myMaster_ = newMaster;
+                newMaster->slaves_.push_back(this);
+
+                break;
+            }
+        }
+
+        if (state_ != SLAVE  && teamSize != 0) state_ = MASTER;
+
+    }
+
+    /**
+        @brief Commands the slaves of a master into a formation. Called by a master.
+    */
+    void ArtificialController::commandSlaves() 
+    {
+        if(this->state_ != MASTER) return;
+
+        Quaternion orient = this->getControllableEntity()->getOrientation();
+        Vector3 dest = this->getControllableEntity()->getPosition();
+
+        // 1 slave: follow
+        if (this->slaves_.size() == 1)
+        {
+            dest += 4*orient*WorldEntity::BACK;
+            this->slaves_.front()->setTargetPosition(dest);
+        }
+        else 
+        {
+            dest += 1.0f*orient*WorldEntity::BACK;
+            Vector3 pos = Vector3::ZERO;
+            int i = 1;
+
+            for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
+            {
+                pos = Vector3::ZERO;
+                if (i <= 1) pos += dest  + FORMATION_WIDTH*(orient*WorldEntity::LEFT);
+                if (i == 2) pos += dest  + FORMATION_WIDTH*(orient*WorldEntity::RIGHT);
+                if (i == 3) pos += dest  + FORMATION_WIDTH*(orient*WorldEntity::UP);
+                if (i >= 4)
+                {
+                    pos += dest  + FORMATION_WIDTH*(orient*WorldEntity::DOWN);
+                    i = 1;
+                    dest += FORMATION_LENGTH*(orient*WorldEntity::BACK);
+                    (*it)->setTargetPosition(pos);
+                    continue;
+                }
+                i++;
+                (*it)->setTargetPosition(pos);
+            }
+        }
+    }
+
+    /**
+        @brief Sets a new master within the formation. Called by a master.
+    */
+    void ArtificialController::setNewMasterWithinFormation()
+    {
+        if(this->state_ != MASTER) return;
+
+        if (this->slaves_.empty())
+            return;
+
+        ArtificialController *newMaster = this->slaves_.back();
+        this->slaves_.pop_back();
+
+        if(!newMaster) return;
+        newMaster->state_ = MASTER;
+        newMaster->slaves_ = this->slaves_;
+
+        this->slaves_.clear();
+        this->state_ = SLAVE;
+        this->myMaster_ = newMaster;
+
+        for(std::vector<ArtificialController*>::iterator it = newMaster->slaves_.begin(); it != newMaster->slaves_.end(); it++)
+        {
+            (*it)->myMaster_ = newMaster;
+        }
+
+    }
+
+    /**
+        @brief Frees all slaves form a master. Called by a master.
+    */
+    void ArtificialController::freeSlaves()
+    {
+        if(this->state_ != MASTER) return;
+
+        for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
+        {
+            (*it)->state_ = FREE;
+        }
+        this->slaves_.clear();
+    }
+
+    /**
+        @brief Master sets its slaves free for @var FREEDOM_COUNT seconds.
+    */
+    void ArtificialController::forceFreeSlaves()
+    {
+        if(this->state_ != MASTER) return;
+
+        for(std::vector<ArtificialController*>::iterator it = slaves_.begin(); it != slaves_.end(); it++)
+        {
+            (*it)->state_ = FREE;
+            (*it)->forceFreedom();
+            (*it)->targetPosition_ = this->targetPosition_;
+            (*it)->bShooting_ = true;
+//             (*it)->getControllableEntity()->fire(0);// fire once for fun
+        }
+    }
+
+    void ArtificialController::loseMasterState()
+    {
+        this->freeSlaves();
+        this->state_ = FREE;
+    }
+
+
+    void ArtificialController::forceFreedom()
+    {
+        this->freedomCount_ = FREEDOM_COUNT;
+    }
+
+    /**
+        @brief Checks wether caller has been forced free, decrements time to stay forced free.
+        @return true if forced free.
+    */
+    bool ArtificialController::forcedFree()
+    {
+        if(this->freedomCount_ > 0) 
+        {
+            this->freedomCount_--;
+            return true;
+        } else return false;
+    }
+
+    /**
+        @brief Used to continue a "specific master action" for a certain time and resuming normal behaviour after.
+    */
+    void ArtificialController::specificMasterActionHold()
+    {
+        if(this->state_ != MASTER) return;
+
+        if (specificMasterActionHoldCount_ == 0) 
+         {
+            this->specificMasterAction_ = NONE;
+            this->searchNewTarget();
+         }
+        else specificMasterActionHoldCount_--;
+    }
+
+    /**
+        @brief Master initializes a 180 degree turn. Leads to a "specific master action".
+    */
+    void ArtificialController::turn180Init()
+    {
+        COUT(0) << "~turnInit" << std::endl;
+        if(this->state_ != MASTER) return;
+
+        Quaternion orient = this->getControllableEntity()->getOrientation();
+
+        this->setTargetPosition(this->getControllableEntity()->getPosition() + 1000.0f*orient*WorldEntity::BACK);
+
+        this->specificMasterActionHoldCount_ = 4;
+
+        this->specificMasterAction_ = TURN180;
+    }
+
+    /**
+        @brief Execute the 180 degree turn. Called within tick.
+    */
+    void ArtificialController::turn180()
+    {
+            Vector2 coord = get2DViewdirection(this->getControllableEntity()->getPosition(), this->getControllableEntity()->getOrientation() * WorldEntity::FRONT, this->getControllableEntity()->getOrientation() * WorldEntity::UP, this->targetPosition_);
+
+            this->getControllableEntity()->rotateYaw(-2.0f * sgn(coord.x) * coord.x*coord.x);
+            this->getControllableEntity()->rotatePitch(2.0f * sgn(coord.y) * coord.y*coord.y);
+
+            this->getControllableEntity()->moveFrontBack(SPEED_MASTER);
+    }
+
+    /**
+        @brief Master initializes a spin around its looking direction axis. Leads to a "specific master action". Not yet implemented.
+    */
+    void ArtificialController::spinInit()
+    {
+        COUT(0) << "~spinInit" << std::endl;
+        if(this->state_ != MASTER) return;
+        this->specificMasterAction_ = SPIN;
+        this->specificMasterActionHoldCount_ = 10;
+    }
+
+    /**
+        @brief Execute the spin. Called within tick.
+    */
+    void ArtificialController::spin()
+    {
+            this->moveToTargetPosition();
+            this->getControllableEntity()->rotateRoll(0.8f);
+    }
+
+    /**
+        @brief Master begins to follow a human player. Is a "specific master action".
+        @param humanController human to follow.
+        @param alaways follows human forever if true, else it follows it for @var SECONDS_TO_FOLLOW_HUMAN seconds.
+    */
+    void ArtificialController::followHumanInit(Pawn* human, bool always)
+    {
+        COUT(0) << "~followInit" << std::endl;
+        if (human == NULL || this->state_ != MASTER)
+            return;
+
+        this->specificMasterAction_  =  FOLLOWHUMAN;
+
+        this->setTarget(human);
+        if (!always)
+            this->specificMasterActionHoldCount_ = SECONDS_TO_FOLLOW_HUMAN;
+        else 
+            this->specificMasterActionHoldCount_ = INT_MAX; //for now...
+
+    }
+
+    /**
+        @brief Follows target with adjusted speed. Called within tick.
+    */
+    void ArtificialController::follow()
+    {
+        this->moveToTargetPosition(); //standard position apprach for now.
+    }
+
+
 
     void ArtificialController::setTargetPosition(const Vector3& target)
@@ -145,5 +676,5 @@
         this->bHasTargetPosition_ = (this->targetPosition_ != Vector3::ZERO);
 
-        Pawn* pawn = dynamic_cast<Pawn*>(this->getControllableEntity());
+        Pawn* pawn = orxonox_cast<Pawn*>(this->getControllableEntity());
         if (pawn)
             pawn->setAimPosition(this->targetPosition_);
@@ -189,15 +720,25 @@
         int team2 = -1;
 
-        if (entity1->getXMLController())
-        {
-            WaypointPatrolController* wpc = orxonox_cast<WaypointPatrolController*>(entity1->getXMLController());
-            if (wpc)
-                team1 = wpc->getTeam();
-        }
-        if (entity2->getXMLController())
-        {
-            WaypointPatrolController* wpc = orxonox_cast<WaypointPatrolController*>(entity2->getXMLController());
-            if (wpc)
-                team2 = wpc->getTeam();
+        Controller* controller = 0;
+        if (entity1->getController())
+            controller = entity1->getController();
+        else
+            controller = entity1->getXMLController();
+        if (controller)
+        {
+            ArtificialController* ac = orxonox_cast<ArtificialController*>(controller);
+            if (ac)
+                team1 = ac->getTeam();
+        }
+
+        if (entity1->getController())
+            controller = entity1->getController();
+        else
+            controller = entity1->getXMLController();
+        if (controller)
+        {
+            ArtificialController* ac = orxonox_cast<ArtificialController*>(controller);
+            if (ac)
+                team2 = ac->getTeam();
         }
 
@@ -246,4 +787,16 @@
         }
 
+        DroneController* droneController = 0;
+        droneController = orxonox_cast<DroneController*>(entity1->getController());
+        if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity2)
+            return true;
+        droneController = orxonox_cast<DroneController*>(entity2->getController());
+        if (droneController && static_cast<ControllableEntity*>(droneController->getOwner()) == entity1)
+            return true;
+        DroneController* droneController1 = orxonox_cast<DroneController*>(entity1->getController());
+        DroneController* droneController2 = orxonox_cast<DroneController*>(entity2->getController());
+        if (droneController1 && droneController2 && droneController1->getOwner() == droneController2->getOwner())
+            return true;
+
         Dynamicmatch* dynamic = orxonox_cast<Dynamicmatch*>(gametype);
         if (dynamic)
Index: code/branches/presentation3/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/ArtificialController.h	(revision 7031)
+++ code/branches/presentation3/src/orxonox/controllers/ArtificialController.h	(revision 7034)
@@ -23,5 +23,5 @@
  *      Fabian 'x3n' Landau
  *   Co-authors:
- *      ...
+ *      Dominik Solenicki
  *
  */
@@ -32,6 +32,9 @@
 #include "OrxonoxPrereqs.h"
 
+#include <vector>
+
 #include "util/Math.h"
 #include "Controller.h"
+#include "controllers/NewHumanController.h"
 
 namespace orxonox
@@ -43,11 +46,69 @@
             virtual ~ArtificialController();
 
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+
             void abandonTarget(Pawn* target);
 
+            inline void setTeam(int team)
+                { this->team_ = team; }
+            inline int getTeam() const
+                { return this->team_; }
+            inline void setFormationFlight(bool formation)
+                { this->formationFlight_ = formation; }
+            inline bool getFormationFlight() const
+                { return this->formationFlight_; }
+            inline void setFormationSize(int size)
+                { this->maxFormationSize_ = size; }
+            inline int getFormationSize() const
+                { return this->maxFormationSize_; }
+            virtual void changedControllableEntity();
+
+            static void formationflight(bool form);
+            static void masteraction(int action);
+            static void followme();
+            static void passivebehaviour(bool passive);
+            static void formationsize(int size);
+
         protected:
+
+            int team_;
+            bool formationFlight_;
+            bool passive_;
+            unsigned int maxFormationSize_;
+            int freedomCount_;
+            enum State {SLAVE, MASTER, FREE};
+            State state_;
+            std::vector<ArtificialController*> slaves_;
+            ArtificialController *myMaster_;
+            enum SpecificMasterAction {NONE, HOLD, SPIN, TURN180, FOLLOWHUMAN};
+            SpecificMasterAction specificMasterAction_;
+            int specificMasterActionHoldCount_;
+            Pawn* humanToFollow_;
+
             void targetDied();
 
             void moveToPosition(const Vector3& target);
             void moveToTargetPosition();
+
+            int getState();
+
+            void unregisterSlave();
+            void searchNewMaster();
+            void commandSlaves();
+            void setNewMasterWithinFormation();
+
+            void freeSlaves();
+            void forceFreeSlaves();
+            void loseMasterState();
+            void forceFreedom();
+            bool forcedFree();
+
+            void specificMasterActionHold();
+            void turn180Init();
+            void turn180();
+            void spinInit();
+            void spin();
+            void followHumanInit(Pawn* human, bool always);
+            void follow();
 
             void setTargetPosition(const Vector3& target);
Index: code/branches/presentation3/src/orxonox/controllers/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/CMakeLists.txt	(revision 7031)
+++ code/branches/presentation3/src/orxonox/controllers/CMakeLists.txt	(revision 7034)
@@ -8,3 +8,4 @@
   WaypointController.cc
   WaypointPatrolController.cc
+  DroneController.cc
 )
Index: code/branches/presentation3/src/orxonox/controllers/DroneController.cc
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/DroneController.cc	(revision 7034)
+++ code/branches/presentation3/src/orxonox/controllers/DroneController.cc	(revision 7034)
@@ -0,0 +1,139 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "DroneController.h"
+#include "worldentities/Drone.h"
+#include "util/Math.h"
+
+#include "core/CoreIncludes.h"
+#include "core/Executor.h"
+#include "worldentities/ControllableEntity.h"
+
+namespace orxonox
+{
+    /**
+    @brief
+        Constructor.
+    */
+    CreateFactory(DroneController);
+
+    static const float ACTION_INTERVAL = 1.0f;
+
+    DroneController::DroneController(BaseObject* creator) : ArtificialController(creator)
+    {
+        RegisterObject(DroneController);
+
+        this->owner_ = 0;
+        this->drone_ = 0;
+
+        this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&DroneController::action, this)));
+
+        this->owner_.setCallback(createFunctor(&DroneController::ownerDied, this));
+    }
+
+    DroneController::~DroneController()
+    {
+    }
+
+    void DroneController::setOwner(Pawn* owner){
+        this->owner_ = owner;
+    } 
+
+    void DroneController::setDrone(Drone* drone)
+    {
+        this->drone_ = drone;
+        this->setControllableEntity(drone);
+    }
+    
+    void DroneController::action()
+    {
+        float random;
+        float maxrand = 100.0f / ACTION_INTERVAL;
+
+        const Vector3& ownerPosition = getOwner()->getWorldPosition();
+        const Vector3& dronePosition = getDrone()->getWorldPosition();
+
+        const Vector3& locOwnerDir = getDrone()->getOrientation().UnitInverse()*(ownerPosition-dronePosition); //Vector from Drone To Owner out of drones local coordinate system
+
+        random = rnd(maxrand);
+        if ( random < 30 && (!this->target_))
+            this->searchNewTarget();
+
+        if (random < 50 && this->target_)
+        {
+            this->isShooting_ = true;
+            this->aimAtTarget();
+            drone_->rotateYaw(targetPosition_.x);   //face target
+            drone_->rotatePitch(targetPosition_.y);
+            drone_->fire(0);
+            this->isShooting_ = false;
+        }
+
+    }
+
+    /*
+    @brief
+        The controlling happens here. This method defines what the controller has to do each tick.
+    @param dt
+        The duration of the tick.
+    */
+    void DroneController::tick(float dt)
+    {
+        
+
+	Drone *myDrone = static_cast<Drone*>(this->getControllableEntity());
+        float maxDistanceSquared = this->getDrone()->getMaxDistanceToOwner()*this->getDrone()->getMaxDistanceToOwner();
+        float minDistanceSquared = this->getDrone()->getMinDistanceToOwner()*this->getDrone()->getMinDistanceToOwner();
+        if ((this->getDrone()->getWorldPosition() - this->getOwner()->getWorldPosition()).squaredLength()  > maxDistanceSquared) { 
+            this->moveToPosition(this->getOwner()->getWorldPosition());
+        }
+        else if((this->getDrone()->getWorldPosition() - this->getOwner()->getWorldPosition()).squaredLength() < minDistanceSquared) {
+            this->moveToPosition(-this->getOwner()->getWorldPosition());
+        }
+        else if(!isShooting_) {
+            float random = rnd(2.0f);
+            float randomSelection = rnd(6.0f);
+            if((int)randomSelection==0) drone_->moveUpDown(random);
+            else if((int)randomSelection==1) drone_->moveRightLeft(random);
+            else if((int)randomSelection==2) drone_->moveFrontBack(random);
+            else if((int)randomSelection==3) drone_->rotateYaw(random);
+            else if((int)randomSelection==4) drone_->rotatePitch(random);
+            else if((int)randomSelection==5) drone_->rotateRoll(random);
+        }
+        SUPER(AIController, tick, dt);
+
+    }
+
+    void DroneController::ownerDied()
+    {
+        if (this->drone_)
+            this->drone_->destroy();
+        else
+            this->destroy();
+    }
+}
Index: code/branches/presentation3/src/orxonox/controllers/DroneController.h
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/DroneController.h	(revision 7034)
+++ code/branches/presentation3/src/orxonox/controllers/DroneController.h	(revision 7034)
@@ -0,0 +1,77 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _DroneController_H__
+#define _DroneController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "AIController.h"
+#include "core/WeakPtr.h"
+#include "tools/interfaces/Tickable.h"
+
+#include "tools/Timer.h"
+
+
+namespace orxonox
+{
+    /**
+    @brief
+        Controller for the Drone of the PPS tutorial.
+    @author
+        Oli Scheuss
+    */
+    class _OrxonoxExport DroneController : public ArtificialController, public Tickable
+    {
+        public:
+            DroneController(BaseObject* creator);
+            virtual ~DroneController();
+            
+            virtual void tick(float dt); //!< The controlling happens here. This method defines what the controller has to do each tick.
+
+            void setOwner(Pawn* owner);
+            inline Pawn* getOwner() const
+                { return this->owner_; }
+
+            void setDrone(Drone*  drone);
+            inline Drone* getDrone() const
+                { return this->drone_; }
+
+        protected:
+            virtual void action();
+            void ownerDied();
+            bool isShooting_;
+
+        private:
+            Timer actionTimer_;
+            WeakPtr<Pawn> owner_;
+            Drone* drone_;
+    };
+}
+
+#endif /* _DroneController_H__ */
Index: code/branches/presentation3/src/orxonox/controllers/WaypointPatrolController.cc
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/WaypointPatrolController.cc	(revision 7031)
+++ code/branches/presentation3/src/orxonox/controllers/WaypointPatrolController.cc	(revision 7034)
@@ -42,5 +42,5 @@
         RegisterObject(WaypointPatrolController);
 
-        this->team_ = 0;
+        //this->team_ = 0;
         this->alertnessradius_ = 500;
 
@@ -53,5 +53,5 @@
 
         XMLPortParam(WaypointPatrolController, "alertnessradius", setAlertnessRadius, getAlertnessRadius, xmlelement, mode).defaultValues(500.0f);
-        XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
+//        XMLPortParam(WaypointPatrolController, "team", setTeam, getTeam, xmlelement, mode).defaultValues(0);
     }
 
Index: code/branches/presentation3/src/orxonox/controllers/WaypointPatrolController.h
===================================================================
--- code/branches/presentation3/src/orxonox/controllers/WaypointPatrolController.h	(revision 7031)
+++ code/branches/presentation3/src/orxonox/controllers/WaypointPatrolController.h	(revision 7034)
@@ -46,8 +46,8 @@
             virtual void tick(float dt);
 
-            inline void setTeam(int team)
+           /* inline void setTeam(int team)
                 { this->team_ = team; }
             inline int getTeam() const
-                { return this->team_; }
+                { return this->team_; } */
 
             inline void setAlertnessRadius(float radius)
@@ -59,5 +59,5 @@
             void searchEnemy();
 
-            int team_;
+            //int team_;
             float alertnessradius_;
             Timer patrolTimer_;
Index: code/branches/presentation3/src/orxonox/interfaces/PickupCarrier.h
===================================================================
--- code/branches/presentation3/src/orxonox/interfaces/PickupCarrier.h	(revision 7031)
+++ code/branches/presentation3/src/orxonox/interfaces/PickupCarrier.h	(revision 7034)
@@ -54,4 +54,5 @@
     class InvisiblePickup;
     class MetaPickup;
+    class DronePickup;
     class SpeedPickup;
 
@@ -72,4 +73,5 @@
         friend class InvisiblePickup;
         friend class MetaPickup;
+        friend class DronePickup;
         friend class SpeedPickup;
 
Index: code/branches/presentation3/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/CMakeLists.txt	(revision 7031)
+++ code/branches/presentation3/src/orxonox/worldentities/CMakeLists.txt	(revision 7034)
@@ -5,5 +5,5 @@
   MobileEntity.cc
   ControllableEntity.cc
-
+  Drone.cc
   BigExplosion.cc
   EffectContainer.cc
Index: code/branches/presentation3/src/orxonox/worldentities/Drone.cc
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/Drone.cc	(revision 7034)
+++ code/branches/presentation3/src/orxonox/worldentities/Drone.cc	(revision 7034)
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      ...
+ */
+
+
+#include "Drone.h"
+
+#include "core/XMLPort.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+
+namespace orxonox
+{
+    CreateFactory(Drone);
+    /**
+    @brief
+        Constructor. Registers the object and initializes some default values.
+    */
+    Drone::Drone(BaseObject* creator) : Pawn(creator)
+    {
+	RegisterObject(Drone);
+
+        this->myController_ = 0;
+        
+        this->localLinearAcceleration_.setValue(0, 0, 0);
+        this->localAngularAcceleration_.setValue(0, 0, 0);
+        this->setRadarVisibility(false);
+        this->setCollisionType(WorldEntity::Dynamic);
+        
+        myController_ = new DroneController(static_cast<BaseObject*>(this)); //!< Creates a new controller and passes our this pointer to it as creator.
+        myController_->setDrone(this);
+
+        this->setController(myController_);
+    }
+
+    /**
+    @brief
+        Destructor. Destroys controller, if present.
+    */
+    Drone::~Drone()
+    {
+        if( this->isInitialized() && this->myController_ )
+            delete this->myController_;
+    }
+
+    /**
+    @brief
+        Method for creating a Drone through XML.
+    */
+    void Drone::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        SUPER(Drone, XMLPort, xmlelement, mode);
+
+	XMLPortParam(Drone, "primaryThrust_", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
+	XMLPortParam(Drone, "auxilaryThrust_", setAuxilaryThrust, getAuxilaryThrust, xmlelement, mode);
+	XMLPortParam(Drone, "rotationThrust_", setRotationThrust, getRotationThrust, xmlelement, mode);
+        XMLPortParam(Drone, "maxDistanceToOwner_", setMaxDistanceToOwner, getMaxDistanceToOwner, xmlelement, mode);
+        XMLPortParam(Drone, "minDistanceToOwner_", setMinDistanceToOwner, getMinDistanceToOwner, xmlelement, mode);
+    }
+
+
+    /**
+    @brief
+        Defines which actions the Drone has to take in each tick.
+    @param dt
+        The length of the tick.
+    */
+    void Drone::tick(float dt)
+    {
+        SUPER(Drone, tick, dt);
+        
+        //if (this->hasLocalController())
+        //{
+            this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
+            this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_);
+            if (this->localLinearAcceleration_.z() > 0)
+              this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
+            else
+              this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
+            this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
+            this->localLinearAcceleration_.setValue(0, 0, 0);
+        
+            this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
+            this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
+            this->localAngularAcceleration_.setValue(0, 0, 0);
+        //}
+    }
+    
+    /**
+    @brief
+        Moves the Drone in the negative z-direction (Front/Back) by an amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the movement.
+    */
+    void Drone::moveFrontBack(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
+    }
+
+    /**
+    @brief
+        Moves the Drone in the x-direction (Right/Left) by an amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the movement.
+    */
+    void Drone::moveRightLeft(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Moves the Drone in the y-direction (Up/Down) by an amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the movement.
+    */
+    void Drone::moveUpDown(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the Drone around the y-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void Drone::rotateYaw(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the Drone around the x-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void Drone::rotatePitch(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the Drone around the z-axis by the amount specified by the first component of the input 2-dim vector.
+    @param value
+        The vector determining the amount of the angular movement.
+    */
+    void Drone::rotateRoll(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
+    }
+    
+}
Index: code/branches/presentation3/src/orxonox/worldentities/Drone.h
===================================================================
--- code/branches/presentation3/src/orxonox/worldentities/Drone.h	(revision 7034)
+++ code/branches/presentation3/src/orxonox/worldentities/Drone.h	(revision 7034)
@@ -0,0 +1,147 @@
+/*
+ *   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:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _Drone_H__
+#define _Drone_H__
+
+#include "OrxonoxPrereqs.h"
+#include "worldentities/pawns/Pawn.h"
+#include "controllers/DroneController.h"
+
+namespace orxonox
+{
+
+    /**
+    @brief
+        Drone, that is made to move upon a specified pattern.
+        This class was constructed for the PPS tutorial.
+    @author
+        Oli Scheuss
+    */
+    class _OrxonoxExport Drone : public Pawn
+    {
+        public:
+            Drone(BaseObject* creator);
+            virtual ~Drone();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating a Drone through XML.
+            virtual void tick(float dt); //!< Defines which actions the Drone has to take in each tick.
+
+            
+            virtual void moveFrontBack(const Vector2& value);
+            virtual void moveRightLeft(const Vector2& value);
+            virtual void moveUpDown(const Vector2& value);
+
+            virtual void rotateYaw(const Vector2& value);
+            virtual void rotatePitch(const Vector2& value);
+            virtual void rotateRoll(const Vector2& value);
+            
+            /**
+            @brief Moves the Drone in the Front/Back-direction by the specifed amount.
+            @param value  The amount by which the drone is to be moved.
+            */
+            inline void moveFrontBack(float value)
+            { this->moveFrontBack(Vector2(value, 0)); }
+            /**
+            @brief Moves the Drone in the Right/Left-direction by the specifed amount.
+            @param value  The amount by which the drone is to be moved.
+            */
+            inline void moveRightLeft(float value)
+            { this->moveRightLeft(Vector2(value, 0)); }
+            /**
+            @brief Moves the Drone in the Up/Down-direction by the specifed amount.
+            @param value  The amount by which the drone is to be moved.
+            */
+            inline void moveUpDown(float value)
+            { this->moveUpDown(Vector2(value, 0)); }
+            
+            /**
+            @brief Rotates the Drone around the y-axis by the specifed amount.
+            @param value  The amount by which the drone is to be rotated.
+            */
+            inline void rotateYaw(float value)
+            { this->rotateYaw(Vector2(value, 0)); }
+            /**
+            @brief Rotates the Drone around the x-axis by the specifed amount.
+            @param value  The amount by which the drone is to be rotated.
+            */
+            inline void rotatePitch(float value)
+            { this->rotatePitch(Vector2(value, 0)); }
+            /**
+            @brief Rotates the Drone around the z-axis by the specifed amount.
+            @param value  The amount by which the drone is to be rotated.
+            */
+            inline void rotateRoll(float value)
+            { this->rotateRoll(Vector2(value, 0)); }
+            
+            /**
+            @brief Sets the primary thrust to the input amount.
+            @param thrust The amount of thrust.
+            */
+            inline void setPrimaryThrust( float thrust )
+                { this->primaryThrust_=thrust; }      
+            inline void setAuxilaryThrust( float thrust )
+                { this->auxilaryThrust_=thrust; }      
+            inline void setRotationThrust( float thrust )
+                { this->rotationThrust_=thrust; }      
+            inline void setMaxDistanceToOwner( float distance)
+                { this->maxDistanceToOwner_=distance; }
+            inline void setMinDistanceToOwner( float distance)
+                { this->minDistanceToOwner_=distance; }
+                	
+            
+            /**
+            @brief Gets the primary thrust to the input amount.
+            @preturn The amount of thrust.
+            */
+            inline float getPrimaryThrust()
+                { return this->primaryThrust_; }
+	    inline float getAuxilaryThrust()
+                { return this->auxilaryThrust_; }
+	    inline float getRotationThrust()
+                { return this->rotationThrust_; }
+	    inline float getMaxDistanceToOwner()
+                { return this->maxDistanceToOwner_; }
+            inline float getMinDistanceToOwner()
+                { return this->minDistanceToOwner_; }
+            
+        private:
+            DroneController *myController_; //!< The controller of the Drone.
+            
+            btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the Drone the next tick.
+            btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the Drone the next tick.
+            float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward. 
+            float auxilaryThrust_; //!< The amount of auxilary thrust. Used for all other movements (except for rotations).
+            float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.
+            float maxDistanceToOwner_; //Maximum Distance to owner
+            float minDistanceToOwner_; //Minimum Distance to owner
+    };
+
+}
+
+#endif /* _Drone_H__ */
