[Orxonox-commit 1182] r5903 - code/branches/tutorial/src/orxonox/controllers

ambuehlm at orxonox.net ambuehlm at orxonox.net
Wed Oct 7 15:44:26 CEST 2009


Author: ambuehlm
Date: 2009-10-07 15:44:26 +0200 (Wed, 07 Oct 2009)
New Revision: 5903

Added:
   code/branches/tutorial/src/orxonox/controllers/DroneController.cc_ambuehlm
Log:
First Try to insert a Drone(Tutorial)

Copied: code/branches/tutorial/src/orxonox/controllers/DroneController.cc_ambuehlm (from rev 5901, code/branches/tutorial/src/orxonox/controllers/DroneController.cc)
===================================================================
--- code/branches/tutorial/src/orxonox/controllers/DroneController.cc_ambuehlm	                        (rev 0)
+++ code/branches/tutorial/src/orxonox/controllers/DroneController.cc_ambuehlm	2009-10-07 13:44:26 UTC (rev 5903)
@@ -0,0 +1,76 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Oli Scheuss
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "DroneController.h"
+#include "worldentities/Drone.h"
+#include "util/Math.h"
+
+
+namespace orxonox
+{
+		CreateFactory(DroneController);
+    /**
+    @brief
+        Constructor.
+    */
+    DroneController::DroneController(BaseObject* creator) : Controller(creator)
+    {
+        // Place your code here:
+        // - make sure to register the object in the factory
+        // - do any kind of initialisation
+        RegisterObject(DroneController);
+        // this checks that our creator really is a drone
+        // and saves the pointer to the drone for the controlling commands
+        assert(dynamic_cast<Drone*>(creator)!=0);
+        this->setControllableEntity(dynamic_cast<Drone*>(creator));
+    }
+
+    DroneController::~DroneController()
+    {
+    }
+
+    /**
+    @brief
+        The controlling happens here. This method defines what the controller has to do each tick.
+    @param dt
+        The duration of the tick.
+    */
+    void DroneController::tick(float dt)
+    {
+        // Place your code here:
+
+		  // many other functions (have a look at src/util/Math.h for details)
+        // - steering commands
+        Drone *myDrone = static_cast<Drone*>(this->getControllableEntity());
+        // you can use the following commands for steering 
+        // - moveFrontBack, moveRightLeft, moveUpDown 
+        // - rotatePitch, rotateYaw, rotateRoll 
+        // - apply the to myDrone (e.g. myDrone->rotateYaw(..) ) 
+
+    }
+}


Property changes on: code/branches/tutorial/src/orxonox/controllers/DroneController.cc_ambuehlm
___________________________________________________________________
Added: svn:mergeinfo
   + /code/branches/libraries/src/orxonox/controllers/DroneController.cc:5612-5692
/code/branches/libraries2/src/orxonox/controllers/DroneController.cc:5703-5733
/code/branches/resource2/src/orxonox/controllers/DroneController.cc:3372-5694
/code/branches/tutorial/src/orxonox/objects/controllers/DroneController.cc:2761-2765
code/branches/buildsystem/src/orxonox/controllers/DroneController.cc:1874-2276,2278-2400
code/branches/buildsystem2/src/orxonox/controllers/DroneController.cc:2506-2658
code/branches/buildsystem3/src/orxonox/controllers/DroneController.cc:2662-2708
code/branches/ceguilua/src/orxonox/controllers/DroneController.cc:1802-1808
code/branches/core3/src/orxonox/controllers/DroneController.cc:1572-1739
code/branches/core4/src/orxonox/controllers/DroneController.cc:3221-3224,3227,3234-3238,3242,3244-3250,3252-3254,3256,3259-3261,3264-3265,3268-3275,3277-3278,3280,3284-3285,3287,3289-3294,3305,3309-3310
code/branches/gametypes/src/orxonox/controllers/DroneController.cc:2826-3031
code/branches/gcc43/src/orxonox/controllers/DroneController.cc:1580
code/branches/gui/src/orxonox/controllers/DroneController.cc:1635-1723,2795-2894
code/branches/input/src/orxonox/controllers/DroneController.cc:1629-1636
code/branches/lodfinal/src/orxonox/controllers/DroneController.cc:2372-2411
code/branches/map/src/orxonox/controllers/DroneController.cc:2801-3086,3089
code/branches/miniprojects/src/orxonox/controllers/DroneController.cc:2754-2824
code/branches/netp2/src/orxonox/controllers/DroneController.cc:2835-2988
code/branches/netp3/src/orxonox/controllers/DroneController.cc:2988-3082
code/branches/netp6/src/orxonox/controllers/DroneController.cc:3214-3302
code/branches/network/src/orxonox/controllers/DroneController.cc:2356
code/branches/network64/src/orxonox/controllers/DroneController.cc:2210-2355
code/branches/objecthierarchy/src/orxonox/controllers/DroneController.cc:1911-2085,2100,2110-2169
code/branches/objecthierarchy2/src/orxonox/controllers/DroneController.cc:2171-2479
code/branches/overlay/src/orxonox/controllers/DroneController.cc:2117-2385
code/branches/particles/src/orxonox/controllers/DroneController.cc:2829-3085
code/branches/pch/src/orxonox/controllers/DroneController.cc:3113-3194
code/branches/physics/src/orxonox/controllers/DroneController.cc:1912-2055,2107-2439
code/branches/physics_merge/src/orxonox/controllers/DroneController.cc:2436-2457
code/branches/pickups/src/orxonox/controllers/DroneController.cc:1926-2086,2127,2827-2915
code/branches/pickups2/src/orxonox/controllers/DroneController.cc:2107-2497,2915-3071
code/branches/presentation/src/orxonox/controllers/DroneController.cc:2369-2652,2654-2660
code/branches/questsystem/src/orxonox/controllers/DroneController.cc:1894-2088
code/branches/questsystem2/src/orxonox/controllers/DroneController.cc:2107-2259
code/branches/questsystem5/src/orxonox/controllers/DroneController.cc:2776-2905
code/branches/resource/src/orxonox/controllers/DroneController.cc:3327-3366
code/branches/script_trigger/src/orxonox/controllers/DroneController.cc:1295-1953,1955
code/branches/sound/src/orxonox/controllers/DroneController.cc:2829-3010
code/branches/weapon/src/orxonox/controllers/DroneController.cc:1925-2094
code/branches/weapon2/src/orxonox/controllers/DroneController.cc:2107-2488
code/branches/weapons/src/orxonox/controllers/DroneController.cc:2897-3051
code/branches/weaponsystem/src/orxonox/controllers/DroneController.cc:2742-2890




More information about the Orxonox-commit mailing list