[Orxonox-commit 7218] r11832 - in code/branches/3DPacman_FS18: . src/modules src/modules/3DPacman src/orxonox/controllers src/orxonox/worldentities

dreherm at orxonox.net dreherm at orxonox.net
Sun Mar 25 01:20:04 CET 2018


Author: dreherm
Date: 2018-03-25 01:20:03 +0100 (Sun, 25 Mar 2018)
New Revision: 11832

Added:
   code/branches/3DPacman_FS18/src/modules/3DPacman/
   code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.cc
   code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.h
   code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.cc
   code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.h
   code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.cc
   code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.h
   code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.cc
   code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.h
Removed:
   code/branches/3DPacman_FS18/New_Material/
   code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.cc
   code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.h
   code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.cc
   code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.h
Log:
First files added like controllers and new class

Added: code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.cc	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.cc	2018-03-25 00:20:03 UTC (rev 11832)
@@ -0,0 +1,230 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file 3DPacman.cc
+    @brief Implementation of the 3DPacman class.
+*/
+
+#include "3DPacman.h"
+#include "core/CoreIncludes.h"
+
+namespace orxonox
+{
+    RegisterUnloadableClass(3DPacman);
+
+    3DPacman::3DPacman(Context* context) : Deathmatch(context)
+    {
+        RegisterObject(3DPacman);
+
+        bEndGame = false;
+        lives = 1;
+        level = 1;
+        point = 0;
+        bShowLevel = false;
+        multiplier = 1;
+        b_combo = false;
+        counter = 5000;
+        pattern = 1;
+        lastPosition = 0;
+        // spawn enemy every 3.5 seconds
+        //enemySpawnTimer.setTimer(3.5f, true, createExecutor(createFunctor(&DodgeRace::spawnEnemy, this)));
+        comboTimer.setTimer(3.0f, true, createExecutor(createFunctor(&DodgeRace::comboControll, this)));
+        this->numberOfBots_ = 0; //sets number of default bots temporarly to 0
+        this->center_ = nullptr;
+
+        this->setHUDTemplate("DodgeRaceHUD");
+    }
+
+    void DodgeRace::levelUp()
+    {
+        level++;
+        if (getPlayer() != nullptr)
+        {
+            for (int i = 0; i < 7; i++)
+            {
+                WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
+                chunk5->setPosition(Vector3(600, 0, 100.f * i - 300));
+                chunk5->setVelocity(Vector3(1000, 0, 0));  //player->getVelocity()
+                chunk5->setScale(10);
+                chunk5->setEffect1("Orxonox/explosion2b");
+                chunk5->setEffect2("Orxonox/smoke6");
+                chunk5->Explode();
+
+            }
+        }
+        addPoints(multiplier * 42);
+        multiplier *= 2;
+        toggleShowLevel();
+        showLevelTimer.setTimer(1.0f, false, createExecutor(createFunctor(&DodgeRace::toggleShowLevel, this)));
+    }
+
+    void DodgeRace::tick(float dt)
+    {
+        DodgeRaceShip* player = this->getPlayer();
+        if (player != nullptr)
+        {
+            currentPosition = player->getWorldPosition().x;
+            counter = counter + (currentPosition - lastPosition);
+            lastPosition = currentPosition;
+            point = (int) currentPosition;
+            player->speed = 830.0f - (point / 1000);
+
+            for(unsigned int i=0; i < cubeList.size();i++)
+            {
+                if(cubeList.at(i)->getPosition().x < currentPosition-3000)
+                {
+                    cubeList.at(i)->destroy();
+                    cubeList.erase(cubeList.begin()+i);
+                }
+            }
+
+            if(counter >= 3000)
+            {
+                counter = 0;
+                for(int i = 0; i<6; i++)
+                {
+                    DodgeRaceCube* cube = new DodgeRaceCube(this->center_->getContext());
+                    cubeList.push_back(cube);
+                    switch(pattern)
+                    {
+                    case 1: cube->addTemplate("DodgeRaceCube01");
+                    break;
+                    case 2: cube->addTemplate("DodgeRaceCube02");
+                    break;
+
+                    }
+
+                    cube->setPosition(player->getWorldPosition() + Vector3(5000.0f, 0.0f, -3600.0f + (i*1200)));
+                    //stEntity->setScale3D(50,50,50);
+                }
+
+
+                pattern %= 2;
+                pattern ++;
+
+            }
+
+        }
+        SUPER(DodgeRace, tick, dt);
+    }
+
+    DodgeRaceShip* DodgeRace::getPlayer()
+    {
+        for (DodgeRaceShip* ship : ObjectList<DodgeRaceShip>())
+        {
+            return ship;
+        }
+        return nullptr;
+    }
+
+    void DodgeRace::costLife()
+    {
+        //endGameTimer.setTimer(8.0f, false, createExecutor(createFunctor(&DodgeRace::end, this)));
+        lives = 0;
+    };
+
+    void DodgeRace::comboControll()
+    {
+        if (b_combo)
+            multiplier++;
+        // if no combo was performed before, reset multiplier
+        else
+            multiplier = 1;
+        b_combo = false;
+    }
+
+    void DodgeRace::start()
+    {
+        orxout() << "start" << endl;
+        for(unsigned int i=0; i< cubeList.size();i++)
+        {
+            cubeList.at(i)->destroy();
+            cubeList.erase(cubeList.begin()+i);
+
+        }
+        cubeList.clear();
+        // Set variable to temporarily force the player to spawn.
+        this->bForceSpawn_ = false;
+
+        if (this->center_ == nullptr)  // abandon mission!
+        {
+            orxout(internal_error) << "DodgeRace: No Centerpoint specified." << endl;
+            GSLevel::startMainMenu();
+            return;
+        }
+        // Call start for the parent class.
+        Deathmatch::start();
+    }
+
+    void DodgeRace::playerPreSpawn(PlayerInfo* player)
+    {
+        this->playerInfo_ = player;
+        if(lives <= 0)
+        {
+            this->end();
+        }
+
+        // Reset all the cubes
+        /*
+        orxout() << "prespawn" << endl;
+        for(int i=0; i< cubeList.size();i++)
+        {
+            cubeList.at(i)->destroy();
+            cubeList.erase(cubeList.begin()+i);
+        }
+        cubeList.clear();
+        lives = 1;
+        point = 0;
+        lastPosition = 0;
+        */
+    }
+
+    void DodgeRace::addPoints(int numPoints)
+    {
+        if (!bEndGame)
+        {
+            point += numPoints * multiplier;
+            b_combo = true;
+        }
+    }
+
+    void DodgeRace::end()
+    {
+        // DON'T CALL THIS!
+        //      Deathmatch::end();
+        // It will misteriously crash the game!
+        // Instead startMainMenu, this won't crash.
+        if (Highscore::exists())
+        {
+            int score = this->getPoints();
+            Highscore::getInstance().storeScore("Dodge Race", score, this->playerInfo_);
+        }
+        GSLevel::startMainMenu();
+    }
+}


Property changes on: code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.cc
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.h	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.h	2018-03-25 00:20:03 UTC (rev 11832)
@@ -0,0 +1,145 @@
+/*
+ *   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:
+ *      Florian Zinggeler
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+/**
+    @file DodgeRace.h
+    @brief Gametype.
+    @ingroup DodgeRace
+*/
+
+#ifndef _3DPacman_H__
+#define _3DPacman_H__
+
+#include "dodgerace/DodgeRacePrereqs.h"
+
+#include "DodgeRaceCenterPoint.h" // Necessary for WeakPointer??
+//#include "DodgeRaceShip.h"        DO NOT include in Header. Will cause forward declaration issues
+
+//#include "DodgeRaceHUDinfo.h"
+
+
+#include "core/EventIncludes.h"
+#include "core/command/Executor.h"
+#include "core/config/ConfigValueIncludes.h"
+
+#include "gamestates/GSLevel.h"
+#include "chat/ChatManager.h"
+#include <vector>
+
+// ! HACK
+#include "infos/PlayerInfo.h"
+
+#include "core/command/ConsoleCommand.h"
+
+#include "gametypes/Deathmatch.h"
+#include "tools/Timer.h"
+
+namespace orxonox
+{
+
+    class _DodgeRaceExport DodgeRace : public Deathmatch
+    {
+       public:
+            DodgeRace(Context* context);
+
+            virtual void start() override;
+            virtual void end() override;
+
+            virtual void tick(float dt) override;
+
+            virtual void playerPreSpawn(PlayerInfo* player) override;
+
+            void levelUp();
+
+            int getLives(){return this->lives;}
+            int getLevel(){return this->level;}
+            int getPoints(){return this->point;}
+            int getMultiplier(){return this->multiplier;}
+
+            void setCenterpoint(DodgeRaceCenterPoint* center)
+                       { this->center_ = center; }
+            virtual void addBots(unsigned int amount) override{} //<! overwrite function in order to bypass the addbots command
+
+            // checks if multiplier should be reset.
+            void comboControll();
+            void costLife();
+
+            bool bEndGame;
+            bool bShowLevel;
+            int lives;
+            int multiplier;
+            float counter;
+            int pattern;
+            float currentPosition;
+            float lastPosition;
+
+       private:
+            Timer endGameTimer;
+
+            DodgeRaceShip* getPlayer();
+            WeakPtr<PlayerInfo> playerInfo_;
+            std::vector<DodgeRaceCube*> cubeList;
+            void toggleShowLevel(){bShowLevel = !bShowLevel;}
+            void addPoints(int numPoints);
+
+            WeakPtr<DodgeRaceCenterPoint> center_;
+            int level;
+            int point;
+            bool b_combo;
+
+            Timer enemySpawnTimer;
+            Timer comboTimer;
+            Timer showLevelTimer;
+
+
+         /*
+
+            //void spawnEnemy();
+
+
+
+
+
+
+
+
+
+
+
+
+        private:
+
+
+
+
+            //Context* context;
+            */
+    };
+}
+
+#endif /* _DodgeRace_H__ */


Property changes on: code/branches/3DPacman_FS18/src/modules/3DPacman/3DPacman.h
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.cc	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.cc	2018-03-25 00:20:03 UTC (rev 11832)
@@ -0,0 +1,177 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#include "PacmanGhost.h"
+
+#include "core/CoreIncludes.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+
+namespace orxonox
+{
+    RegisterClass(PacmanGhost);
+
+    /**
+    @brief
+        Constructor. Registers the object and initializes some default values.
+    @param creator
+        The creator of this object.
+    */
+    PacmanGhost::PacmanGhost(Context* context) : ControllableEntity(context)
+    {
+        RegisterObject(PacmanGhost);
+
+        this->myController_ = NULL;
+
+        this->localLinearAcceleration_.setValue(0, 0, 0);
+        this->localAngularAcceleration_.setValue(0, 0, 0);
+        this->primaryThrust_  = 100;
+        this->auxiliaryThrust_ = 100;
+        this->rotationThrust_ = 10;
+
+        this->setCollisionType(CollisionType::Dynamic);
+    }
+
+    /**
+    @brief
+        Destructor. Destroys controller, if present.
+    */
+    PacmanGhost::~PacmanGhost()
+    {
+        // Deletes the controller if the object was initialized and the pointer to the controller is not NULL.
+        if( this->isInitialized() && this->myController_ != NULL )
+            delete this->myController_;
+    }
+
+    /**
+    @brief
+        Method for creating a AutonomousDrone through XML.
+    */
+    void PacmanGhost::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        // This calls the XMLPort function of the parent class
+        SUPER(PacmanGhost, XMLPort, xmlelement, mode);
+
+        XMLPortParam(PacmanGhost, "primaryThrust", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
+        // Make sure you add the variables auxiliaryThrust_ and rotationThrust_ to XMLPort.
+        // Variables can be added by the following command
+        // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunctionName, getFunctionName, xmlelement, mode);
+        // Also make sure that you also create the get- and set-functions in AutonomousDrone.h. As you can see, the get- and set-functions for the variable primaryThrust_ has already been specified there, so you can get your inspiration from there.
+    }
+
+    /**
+    @brief
+        Defines which actions the AutonomousDrone has to take in each tick.
+    @param dt
+        The length of the tick.
+    */
+    void PacmanGhost::tick(float dt)
+    {
+        SUPER(PacmanGhost, tick, dt);
+
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxiliaryThrust_);
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxiliaryThrust_);
+        if (this->localLinearAcceleration_.z() > 0)
+            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxiliaryThrust_);
+        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 AutonomousDrone 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 PacmanGhost::moveFrontBack(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
+    }
+
+    /**
+    @brief
+        Moves the AutonomousDrone 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 PacmanGhost::moveRightLeft(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Moves the AutonomousDrone 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 PacmanGhost::moveUpDown(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the AutonomousDrone 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 PacmanGhost::rotateYaw(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
+    }
+
+    /**
+    @brief
+        Rotates the AutonomousDrone 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 PacmanGhost::rotatePitch(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the AutonomousDrone 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 PacmanGhost::rotateRoll(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
+    }
+
+}


Property changes on: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.cc
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.h	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.h	2018-03-25 00:20:03 UTC (rev 11832)
@@ -0,0 +1,126 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#ifndef _PacmanGhost_H__
+#define _PacmanGhost_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/XMLPort.h"
+#include "controllers/PacmanGhostController.h"
+
+#include "ControllableEntity.h"
+
+namespace orxonox {
+
+    class _OrxonoxExport PacmanGhost : public ControllableEntity
+    {
+        public:
+            PacmanGhost(Context* context);
+            virtual ~PacmanGhost();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an AutonomousDrone through XML.
+            virtual void tick(float dt); //!< Defines which actions the AutonomousDrone 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; }
+            //TODO: Place your set-functions here.
+            // Hint: auxiliary thrust, rotation thrust.
+            
+            /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getPrimaryThrust()
+                { return this->primaryThrust_; }
+            //TODO: Place your get-functions here.
+
+        private:
+            PacmanGhostController *myController_; //!< The controller of the AutonomousDrone.
+
+            btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the AutonomousDrone the next tick.
+            btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the AutonomousDrone the next tick.
+            float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
+            float auxiliaryThrust_; //!< The amount of auxiliary thrust. Used for all other movements (except for rotations).
+            float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.s
+        
+    };
+
+}
+
+#endif


Property changes on: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhost.h
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.cc	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.cc	2018-03-25 00:20:03 UTC (rev 11832)
@@ -0,0 +1,126 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#include "PacmanGhostController.h"
+
+#include "PacmanGhost.h"
+#include "util/Math.h"
+
+namespace orxonox
+{
+    // Create the factory for the drone controller.
+	RegisterClass(PacmanGhostController);
+
+    /**
+    @brief
+        Constructor.
+    @param context
+        The context of this object.
+    */
+    PacmanGhostRed::PacmanGhostController(Context* context) : Controller(context)
+    {
+        RegisterObject(PacmanGhostController);
+        bool ismoving = false;
+        float reltarget_x;
+        float reltarget_z;  
+        Vector3& actuelposition;     
+    }
+
+    /**
+    @brief
+        Destructor.
+    */
+    PacmanGhostController::~PacmanGhostController()
+    {
+
+    }
+
+    /**
+    @brief
+        The controlling happens here. This method defines what the controller has to do each tick.
+    @param dt
+        The duration of the tick.
+    */
+    void PacmanGhostController::tick(float dt)
+    {
+        /* NOTE: Ugly hack by Sandro to make the tutorial work for the moment.
+         * This will be reverted once the framework update is complete
+         */
+        //AutonomousDrone *myDrone = static_cast<AutonomousDrone*>(this->getControllableEntity());
+        ObjectList<PacmanGhost> objectList;
+        ObjectList<PacmanGhost>::iterator it = objectList.begin();
+        PacmanGhost* myDrone = *it;
+
+        if (myGhost != nullptr)
+        {
+
+            actuelposition = myGhost.getPosition();
+
+            if(actuelposition.x = reltarget_x && actuelposition.z = reltarget_z){
+                    ismoving = false;
+            }
+
+
+
+            if(ismoving){
+                moveRightLeft();
+                moveFrontBack(); 
+            }
+        
+            else{
+
+                //hashtable
+
+                int random = rand();
+
+                switch(actuelposition) {
+                    case 1: if(random % 4 == 0){
+                            reltarget_x = 250;
+                            reltarget_z = 0;
+                            }
+                            else if(random % 4 == 1){
+                            reltarget_x = 0;
+                            reltarget_z = 250;
+                            }
+                            else if(random % 4 == 2){
+                            reltarget_x = 0;
+                            reltarget_z = -250;
+                            }
+                            else if(random % 4 == 3){
+                            reltarget_x = -250;
+                            reltarget_z = 0;
+                            }
+                            moving = true;
+                    case 2:
+                }
+            }
+
+
+        }
+    }
+}


Property changes on: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.cc
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.h	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.h	2018-03-25 00:20:03 UTC (rev 11832)
@@ -0,0 +1,54 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#ifndef _PacmanGhostController_H__
+#define _PacmanGhostController_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "Controller.h"
+#include "tools/interfaces/Tickable.h"
+
+namespace orxonox
+{
+
+    class _OrxonoxExport PacmanGhostController : public Controller, public Tickable
+    {
+        public:
+            PacmanGhostController(Context* context);
+            virtual ~PacmanGhostController();
+
+            virtual void tick(float dt); 
+
+        protected:
+
+        private:
+    };
+}
+
+#endif 


Property changes on: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanGhostController.h
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.cc
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.cc	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.cc	2018-03-25 00:20:03 UTC (rev 11832)
@@ -0,0 +1,177 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#include "PacmanGhost.h"
+
+#include "core/CoreIncludes.h"
+#include "BulletDynamics/Dynamics/btRigidBody.h"
+
+namespace orxonox
+{
+    RegisterClass(PacmanGhost);
+
+    /**
+    @brief
+        Constructor. Registers the object and initializes some default values.
+    @param creator
+        The creator of this object.
+    */
+    PacmanGhost::PacmanGhost(Context* context) : ControllableEntity(context)
+    {
+        RegisterObject(PacmanGhost);
+
+        this->myController_ = NULL;
+
+        this->localLinearAcceleration_.setValue(0, 0, 0);
+        this->localAngularAcceleration_.setValue(0, 0, 0);
+        this->primaryThrust_  = 100;
+        this->auxiliaryThrust_ = 100;
+        this->rotationThrust_ = 10;
+
+        this->setCollisionType(CollisionType::Dynamic);
+    }
+
+    /**
+    @brief
+        Destructor. Destroys controller, if present.
+    */
+    PacmanGhost::~PacmanGhost()
+    {
+        // Deletes the controller if the object was initialized and the pointer to the controller is not NULL.
+        if( this->isInitialized() && this->myController_ != NULL )
+            delete this->myController_;
+    }
+
+    /**
+    @brief
+        Method for creating a AutonomousDrone through XML.
+    */
+    void PacmanGhost::XMLPort(Element& xmlelement, XMLPort::Mode mode)
+    {
+        // This calls the XMLPort function of the parent class
+        SUPER(PacmanGhost, XMLPort, xmlelement, mode);
+
+        XMLPortParam(PacmanGhost, "primaryThrust", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
+        // Make sure you add the variables auxiliaryThrust_ and rotationThrust_ to XMLPort.
+        // Variables can be added by the following command
+        // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunctionName, getFunctionName, xmlelement, mode);
+        // Also make sure that you also create the get- and set-functions in AutonomousDrone.h. As you can see, the get- and set-functions for the variable primaryThrust_ has already been specified there, so you can get your inspiration from there.
+    }
+
+    /**
+    @brief
+        Defines which actions the AutonomousDrone has to take in each tick.
+    @param dt
+        The length of the tick.
+    */
+    void PacmanGhost::tick(float dt)
+    {
+        SUPER(PacmanGhost, tick, dt);
+
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxiliaryThrust_);
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxiliaryThrust_);
+        if (this->localLinearAcceleration_.z() > 0)
+            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxiliaryThrust_);
+        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 AutonomousDrone 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 PacmanGhost::moveFrontBack(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
+    }
+
+    /**
+    @brief
+        Moves the AutonomousDrone 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 PacmanGhost::moveRightLeft(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Moves the AutonomousDrone 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 PacmanGhost::moveUpDown(const Vector2& value)
+    {
+        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the AutonomousDrone 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 PacmanGhost::rotateYaw(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
+    }
+
+    /**
+    @brief
+        Rotates the AutonomousDrone 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 PacmanGhost::rotatePitch(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x);
+    }
+
+    /**
+    @brief
+        Rotates the AutonomousDrone 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 PacmanGhost::rotateRoll(const Vector2& value)
+    {
+        this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
+    }
+
+}


Property changes on: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.cc
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.h
===================================================================
--- code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.h	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.h	2018-03-25 00:20:03 UTC (rev 11832)
@@ -0,0 +1,126 @@
+/*
+ *   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:
+ *      Damian 'Mozork' Frick
+ *
+ */
+
+#ifndef _PacmanGhost_H__
+#define _PacmanGhost_H__
+
+#include "OrxonoxPrereqs.h"
+
+#include "core/XMLPort.h"
+#include "controllers/PacmanGhostController.h"
+
+#include "ControllableEntity.h"
+
+namespace orxonox {
+
+    class _OrxonoxExport PacmanGhost : public ControllableEntity
+    {
+        public:
+            PacmanGhost(Context* context);
+            virtual ~PacmanGhost();
+
+            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an AutonomousDrone through XML.
+            virtual void tick(float dt); //!< Defines which actions the AutonomousDrone 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; }
+            //TODO: Place your set-functions here.
+            // Hint: auxiliary thrust, rotation thrust.
+            
+            /**
+            @brief Gets the primary thrust to the input amount.
+            @return The amount of thrust.
+            */
+            inline float getPrimaryThrust()
+                { return this->primaryThrust_; }
+            //TODO: Place your get-functions here.
+
+        private:
+            PacmanGhostController *myController_; //!< The controller of the AutonomousDrone.
+
+            btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the AutonomousDrone the next tick.
+            btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the AutonomousDrone the next tick.
+            float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
+            float auxiliaryThrust_; //!< The amount of auxiliary thrust. Used for all other movements (except for rotations).
+            float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.s
+        
+    };
+
+}
+
+#endif


Property changes on: code/branches/3DPacman_FS18/src/modules/3DPacman/PacmanPointSphere.h
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Deleted: code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.cc
===================================================================
--- code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.cc	2018-03-22 15:14:44 UTC (rev 11831)
+++ code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.cc	2018-03-25 00:20:03 UTC (rev 11832)
@@ -1,98 +0,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:
- *      Oli Scheuss
- *   Co-authors:
- *      Damian 'Mozork' Frick
- *
- */
-
-#include "PacmanGhostRed.h"
-
-#include "worldentities/PacmanGhostRed.h"
-#include "util/Math.h"
-
-namespace orxonox
-{
-    // Create the factory for the drone controller.
-	RegisterClass(PacmanGhostRed);
-
-    /**
-    @brief
-        Constructor.
-    @param context
-        The context of this object.
-    */
-    PacmanGhostRed::PacmanGhostRed(Context* context) : Controller(context)
-    {
-        //TODO: Place your code here:
-        // Make sure to register the object and create the factory.        
-
-        // This checks that our context really is a drone
-        // and saves the pointer to the drone for the controlling commands
-        /* NOTE from Sandro: This is currently broken */
-        //AutonomousDrone* drone = dynamic_cast<AutonomousDrone*>(context);
-        //assert(drone != nullptr);
-        //this->setControllableEntity(drone);
-    }
-
-    /**
-    @brief
-        Destructor.
-    */
-    AutonomousDroneController::~AutonomousDroneController()
-    {
-
-    }
-
-    /**
-    @brief
-        The controlling happens here. This method defines what the controller has to do each tick.
-    @param dt
-        The duration of the tick.
-    */
-    void AutonomousDroneController::tick(float dt)
-    {
-        /* NOTE: Ugly hack by Sandro to make the tutorial work for the moment.
-         * This will be reverted once the framework update is complete
-         */
-        //AutonomousDrone *myDrone = static_cast<AutonomousDrone*>(this->getControllableEntity());
-        ObjectList<AutonomousDrone> objectList;
-        ObjectList<AutonomousDrone>::iterator it = objectList.begin();
-        AutonomousDrone* myDrone = *it;
-
-        if (myDrone != nullptr)
-        {
-            //TODO: Place your code here:
-            // Steering commands
-            // You can use the commands provided by the AutonomousDrone to steer it:
-            // - moveFrontBack, moveRightLeft, moveUpDown
-            // - rotatePitch, rotateYaw, rotateRoll
-            // You will see, that the AutonomousDrone has two variants for each of these commands, one with a vector as input and one with just a float. Use the one with just the float as input.
-            // Apply them to myDrone (e.g. myDrone->rotateYaw(..) )
-            // dt is the time passed since the last call of the tick function in seconds.
-
-
-
-        }
-    }
-}

Deleted: code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.h
===================================================================
--- code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.h	2018-03-22 15:14:44 UTC (rev 11831)
+++ code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.h	2018-03-25 00:20:03 UTC (rev 11832)
@@ -1,59 +0,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:
- *      Oli Scheuss
- *   Co-authors:
- *      Damian 'Mozork' Frick
- *
- */
-
-#ifndef _AutonomousDroneController_H__
-#define _AutonomousDroneController_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "Controller.h"
-#include "tools/interfaces/Tickable.h"
-
-namespace orxonox
-{
-    /**
-    @brief
-        Controller for the AutonomousDrone of the PPS tutorial.
-    @author
-        Oli Scheuss
-    */
-    class _OrxonoxExport AutonomousDroneController : public Controller, public Tickable
-    {
-        public:
-            AutonomousDroneController(Context* context);
-            virtual ~AutonomousDroneController();
-
-            virtual void tick(float dt); //!< The controlling happens here. This method defines what the controller has to do each tick.
-
-        protected:
-
-        private:
-    };
-}
-
-#endif /* _AutonomousDroneController_H__ */

Deleted: code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.cc
===================================================================
--- code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.cc	2018-03-22 15:14:44 UTC (rev 11831)
+++ code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.cc	2018-03-25 00:20:03 UTC (rev 11832)
@@ -1,181 +0,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:
- *      Oli Scheuss
- *   Co-authors:
- *      Damian 'Mozork' Frick
- *
- */
-
-#include "PacmanGhostRed.h"
-
-#include "core/CoreIncludes.h"
-#include "BulletDynamics/Dynamics/btRigidBody.h"
-
-namespace orxonox
-{
-    RegisterClass(PacmanGhostRed);
-
-    /**
-    @brief
-        Constructor. Registers the object and initializes some default values.
-    @param creator
-        The creator of this object.
-    */
-    PacmanGhostRed::PacmanGhostRed(Context* context) : ControllableEntity(context)
-    {
-        RegisterObject(PacmanGhostRed);
-
-        this->myController_ = NULL;
-
-        this->localLinearAcceleration_.setValue(0, 0, 0);
-        this->localAngularAcceleration_.setValue(0, 0, 0);
-        this->primaryThrust_  = 100;
-        this->auxiliaryThrust_ = 100;
-        this->rotationThrust_ = 10;
-
-        this->setCollisionType(CollisionType::Dynamic);
-
-        //this->myController_ = new AutonomousDroneController(this); // Creates a new controller and passes our this pointer to it as creator.
-    }
-
-    /**
-    @brief
-        Destructor. Destroys controller, if present.
-    */
-    PacmanGhostRed::~PacmanGhostRed()
-    {
-        // Deletes the controller if the object was initialized and the pointer to the controller is not NULL.
-        if( this->isInitialized() && this->myController_ != NULL )
-            delete this->myController_;
-    }
-
-    /**
-    @brief
-        Method for creating a AutonomousDrone through XML.
-    */
-    void AutonomousDrone::XMLPort(Element& xmlelement, XMLPort::Mode mode)
-    {
-        // This calls the XMLPort function of the parent class
-        SUPER(AutonomousDrone, XMLPort, xmlelement, mode);
-
-        XMLPortParam(PacmanGhostRed, "primaryThrust", setPrimaryThrust, getPrimaryThrust, xmlelement, mode);
-        //TODO: Put your code in here:
-        // Make sure you add the variables auxiliaryThrust_ and rotationThrust_ to XMLPort.
-        // Variables can be added by the following command
-        // XMLPortParam(Classname, "xml-attribute-name (i.e. variablename)", setFunctionName, getFunctionName, xmlelement, mode);
-        // Also make sure that you also create the get- and set-functions in AutonomousDrone.h. As you can see, the get- and set-functions for the variable primaryThrust_ has already been specified there, so you can get your inspiration from there.
-        
-
-    }
-
-    /**
-    @brief
-        Defines which actions the AutonomousDrone has to take in each tick.
-    @param dt
-        The length of the tick.
-    */
-    void AutonomousDrone::tick(float dt)
-    {
-        SUPER(AutonomousDrone, tick, dt);
-
-        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxiliaryThrust_);
-        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxiliaryThrust_);
-        if (this->localLinearAcceleration_.z() > 0)
-            this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxiliaryThrust_);
-        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 AutonomousDrone 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 AutonomousDrone::moveFrontBack(const Vector2& value)
-    {
-        this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() - value.x);
-    }
-
-    /**
-    @brief
-        Moves the AutonomousDrone 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 AutonomousDrone::moveRightLeft(const Vector2& value)
-    {
-        this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() + value.x);
-    }
-
-    /**
-    @brief
-        Moves the AutonomousDrone 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 AutonomousDrone::moveUpDown(const Vector2& value)
-    {
-        this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() + value.x);
-    }
-
-    /**
-    @brief
-        Rotates the AutonomousDrone 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 AutonomousDrone::rotateYaw(const Vector2& value)
-    {
-        this->localAngularAcceleration_.setY(this->localAngularAcceleration_.y() - value.x);
-    }
-
-    /**
-    @brief
-        Rotates the AutonomousDrone 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 AutonomousDrone::rotatePitch(const Vector2& value)
-    {
-        this->localAngularAcceleration_.setX(this->localAngularAcceleration_.x() + value.x);
-    }
-
-    /**
-    @brief
-        Rotates the AutonomousDrone 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 AutonomousDrone::rotateRoll(const Vector2& value)
-    {
-        this->localAngularAcceleration_.setZ(this->localAngularAcceleration_.z() + value.x);
-    }
-
-}

Deleted: code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.h
===================================================================
--- code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.h	2018-03-22 15:14:44 UTC (rev 11831)
+++ code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.h	2018-03-25 00:20:03 UTC (rev 11832)
@@ -1,133 +0,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:
- *      Oli Scheuss
- *   Co-authors:
- *      Damian 'Mozork' Frick
- *
- */
-
-#ifndef _AutonomousDrone_H__
-#define _AutonomousDrone_H__
-
-#include "OrxonoxPrereqs.h"
-
-#include "core/XMLPort.h"
-#include "controllers/AutonomousDroneController.h"
-
-#include "ControllableEntity.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 AutonomousDrone : public ControllableEntity
-    {
-        public:
-            AutonomousDrone(Context* context);
-            virtual ~AutonomousDrone();
-
-            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method for creating an AutonomousDrone through XML.
-            virtual void tick(float dt); //!< Defines which actions the AutonomousDrone 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; }
-            //TODO: Place your set-functions here.
-            // Hint: auxiliary thrust, rotation thrust.
-            
-            /**
-            @brief Gets the primary thrust to the input amount.
-            @return The amount of thrust.
-            */
-            inline float getPrimaryThrust()
-                { return this->primaryThrust_; }
-            //TODO: Place your get-functions here.
-
-        private:
-            AutonomousDroneController *myController_; //!< The controller of the AutonomousDrone.
-
-            btVector3 localLinearAcceleration_; //!< The linear acceleration that is used to move the AutonomousDrone the next tick.
-            btVector3 localAngularAcceleration_; //!< The linear angular acceleration that is used to move the AutonomousDrone the next tick.
-            float primaryThrust_; //!< The amount of primary thrust. This is just used, when moving forward.
-            float auxiliaryThrust_; //!< The amount of auxiliary thrust. Used for all other movements (except for rotations).
-            float rotationThrust_; //!< The amount of rotation thrust. Used for rotations only.s
-        
-    };
-
-}
-
-#endif // _AutonomousDrone_H__



More information about the Orxonox-commit mailing list