[Orxonox-commit 7217] r11831 - in code/branches/3DPacman_FS18: data/levels data/levels/templates src/orxonox/controllers src/orxonox/worldentities

dreherm at orxonox.net dreherm at orxonox.net
Thu Mar 22 16:14:44 CET 2018


Author: dreherm
Date: 2018-03-22 16:14:44 +0100 (Thu, 22 Mar 2018)
New Revision: 11831

Added:
   code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
   code/branches/3DPacman_FS18/data/levels/templates/PacmanGelb.oxt
   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:
New modells added to game

Added: code/branches/3DPacman_FS18/data/levels/3DPacman.oxw
===================================================================
--- code/branches/3DPacman_FS18/data/levels/3DPacman.oxw	                        (rev 0)
+++ code/branches/3DPacman_FS18/data/levels/3DPacman.oxw	2018-03-22 15:14:44 UTC (rev 11831)
@@ -0,0 +1,86 @@
+<LevelInfo
+ name = "3DPacman"
+ description = "A 3DVersion of Pacman."
+ tags = "test"
+ screenshot = "emptylevel.png"
+/>
+
+<?lua
+  include("stats.oxo")
+  include("HUDTemplates3.oxo")
+  include("templates/lodInformation.oxt")
+?>
+
+<?lua
+  include("templates/PacmanGelb.oxt")
+?>
+
+<Level>
+  <templates>
+    <Template link=lodtemplate_default />
+  </templates>
+  <?lua include("includes/notifications.oxi") ?>
+
+  <Scene
+    ambientlight = "0.8, 0.8, 0.8"
+    skybox       = "Orxonox/Starbox"
+  >
+
+    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
+    <SpawnPoint team=0 position="0,10,245" lookat="0,0,0" spawnclass=SpaceShip pawndesign=PacmanGelb />
+
+<StaticEntity position="0,0,25" direction="0,0,0" collisionType=static mass=100000 friction=0.01 >
+    <attached> 
+        <Model position="0,0,0" mesh="PacmanMap.mesh" scale="50" /> 
+    </attached> 
+    <collisionShapes> 
+        <BoxCollisionShape position="0,0,0" halfExtents="250,1,250" />
+        <BoxCollisionShape position="0,20000,0" halfExtents="250,1,250" />
+
+	<BoxCollisionShape position="250,10,0" halfExtents="1,15,250" />
+	<BoxCollisionShape position="-250,10,0" halfExtents="1,15,250" />
+        <BoxCollisionShape position="0,10,250" halfExtents="250,15,1" />
+        <BoxCollisionShape position="0,10,-250" halfExtents="250,15,1" />
+ 
+    </collisionShapes> 
+</StaticEntity>
+
+<StaticEntity position="10,10,10" direction="0,0,0" collisionType=static mass=100000 friction=0.01 >
+    <attached> 
+        <Model position="0,0,0" mesh="PacmanGhostRed.mesh" scale="5" /> 
+    </attached> 
+    <collisionShapes> 
+        <BoxCollisionShape position="0,0,0" halfExtents="0.5,0.5,0.5" /> 
+    </collisionShapes> 
+</StaticEntity>
+
+
+<StaticEntity position="-10,10,-10" direction="0,0,0" collisionType=static mass=100000 friction=0.01 >
+    <attached> 
+        <Model position="0,0,0" mesh="PacmanGhostBlue.mesh" scale="5" /> 
+    </attached> 
+    <collisionShapes> 
+        <BoxCollisionShape position="0,0,0" halfExtents="0.5,0.5,0.5" /> 
+    </collisionShapes> 
+</StaticEntity>
+
+<StaticEntity position="10,10,-10" direction="0,0,0" collisionType=static mass=100000 friction=0.01 >
+    <attached> 
+        <Model position="0,0,0" mesh="PacmanGhostOrange.mesh" scale="5" /> 
+    </attached> 
+    <collisionShapes> 
+        <BoxCollisionShape position="0,0,0" halfExtents="0.5,0.5,0.5" /> 
+    </collisionShapes> 
+</StaticEntity>
+
+<StaticEntity position="-10,10,10" direction="0,0,0" collisionType=static mass=100000 friction=0.01 >
+    <attached> 
+        <Model position="0,0,0" mesh="PacmanGhostPink.mesh" scale="5" /> 
+    </attached> 
+    <collisionShapes> 
+        <BoxCollisionShape position="0,0,0" halfExtents="0.5,0.5,0.5" /> 
+    </collisionShapes> 
+</StaticEntity>
+
+  </Scene>
+</Level>

Added: code/branches/3DPacman_FS18/data/levels/templates/PacmanGelb.oxt
===================================================================
--- code/branches/3DPacman_FS18/data/levels/templates/PacmanGelb.oxt	                        (rev 0)
+++ code/branches/3DPacman_FS18/data/levels/templates/PacmanGelb.oxt	2018-03-22 15:14:44 UTC (rev 11831)
@@ -0,0 +1,96 @@
+<Template name=PacmanGelb>
+  <SpaceShip
+   hudtemplate            = spaceshiphud
+   camerapositiontemplate = spaceshipescortcameras
+   spawnparticlesource    = "Orxonox/fairytwirl"
+   spawnparticleduration  = 3
+   explosionchunks        = 10
+
+   health            = 80
+   maxhealth         = 200
+   initialhealth     = 80
+
+   shieldhealth        = 35
+   initialshieldhealth = 35
+   maxshieldhealth     = 60
+   shieldabsorption    = 0.9
+   shieldrechargerate  = 1
+   shieldrechargewaittime = 1
+
+   primaryThrust     = 150
+   auxilaryThrust    = 30
+   rotationThrust    = 50
+
+   lift = 1;
+   stallSpeed = 220;
+
+   boostPower            = 20
+   boostPowerRate        = 1
+   boostRate             = 5
+   boostCooldownDuration = 10
+
+   shakeFrequency = 15
+   shakeAmplitude = 6
+
+   collisionType     = "dynamic"
+   mass              = 80
+   linearDamping     = 0.7
+   angularDamping    = 0.9999999
+  >
+    <engines>
+      <MultiStateEngine position=" 7.6, 0, 6" template=spaceshipescortengine />
+      <MultiStateEngine position="-7.6, 0, 0" template=spaceshipescortengine />
+    </engines>
+    <attached>
+      <Model position="0,0,0" yaw=180 pitch=0 roll=0 scale=7 mesh="PacmanGelb.mesh" />
+    </attached>
+    <collisionShapes>
+      <BoxCollisionShape position="0,0,0" halfExtents="1,1,1" />
+    </collisionShapes>
+    <explosion>
+      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
+      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+      <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
+
+      <ExplosionPart mesh="explosionparts/escort_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_3.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_4.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_5.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+      <ExplosionPart mesh="explosionparts/escort_part_6.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+    </explosion>
+<?lua
+  include("../includes/weaponSettingsEscort.oxi")
+?>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipescortcameras defaults=0>
+  <SpaceShip>
+    <camerapositions>
+      <CameraPosition position="0,0, 60" drag=false mouselook=true />
+    </camerapositions>
+  </SpaceShip>
+</Template>
+
+<Template name=spaceshipescortengine baseclass=MultiStateEngine>
+  <MultiStateEngine
+   boostfactor    = 2.2
+
+   speedfront     = 200
+   speedback      =  70
+   speedleftright =  70
+   speedupdown    =  0
+
+   defEngineSndNormal = "sounds/Engine_low.ogg"
+   defEngineSndBoost = "sounds/Engine_high.ogg"
+
+   accelerationfront     = 700
+   accelerationbrake     = 700
+   accelerationback      =  125
+   accelerationleftright =  125
+   accelerationupdown    =  0
+  >
+
+  </MultiStateEngine>
+</Template>

Added: code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.cc
===================================================================
--- code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.cc	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.cc	2018-03-22 15:14:44 UTC (rev 11831)
@@ -0,0 +1,98 @@
+/*
+ *   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.
+
+
+
+        }
+    }
+}

Added: code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.h
===================================================================
--- code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.h	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/orxonox/controllers/PacmanGhostRedController.h	2018-03-22 15:14:44 UTC (rev 11831)
@@ -0,0 +1,59 @@
+/*
+ *   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__ */

Added: code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.cc
===================================================================
--- code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.cc	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.cc	2018-03-22 15:14:44 UTC (rev 11831)
@@ -0,0 +1,181 @@
+/*
+ *   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);
+    }
+
+}

Added: code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.h
===================================================================
--- code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.h	                        (rev 0)
+++ code/branches/3DPacman_FS18/src/orxonox/worldentities/PacmanGhostRed.h	2018-03-22 15:14:44 UTC (rev 11831)
@@ -0,0 +1,133 @@
+/*
+ *   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