[Orxonox-commit 72] r2772 - branches/tutorial/src/orxonox/objects/controllers
Aurelian at orxonox.net
Aurelian at orxonox.net
Mon Mar 9 16:49:00 CET 2009
Author: Aurelian
Date: 2009-03-09 16:48:59 +0100 (Mon, 09 Mar 2009)
New Revision: 2772
Added:
branches/tutorial/src/orxonox/objects/controllers/DroneController.cc_aJaggi
Log:
Ich bin auch eine Dronensteuerungsfunktion
Copied: branches/tutorial/src/orxonox/objects/controllers/DroneController.cc_aJaggi (from rev 2771, branches/tutorial/src/orxonox/objects/controllers/DroneController.cc)
===================================================================
--- branches/tutorial/src/orxonox/objects/controllers/DroneController.cc_aJaggi (rev 0)
+++ branches/tutorial/src/orxonox/objects/controllers/DroneController.cc_aJaggi 2009-03-09 15:48:59 UTC (rev 2772)
@@ -0,0 +1,71 @@
+/*
+ * 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 "OrxonoxStableHeaders.h"
+#include "DroneController.h"
+#include "objects/worldentities/Drone.h"
+#include "util/Math.h"
+
+
+namespace orxonox
+{
+ CreateFactory(DroneController);
+ DroneController::DroneController(BaseObject* creator) : Controller(creator)
+ {
+ RegisterObject(DroneController);
+ // Place your code here:
+ // - make sure to register the object in the factory
+ // - do any kind of initialisation
+
+
+
+ // 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()
+ {
+ }
+
+ void DroneController::tick(float dt)
+ {
+ // Place your code here:
+ // - steering commands
+ Drone *myDrone = static_cast<Drone*>(this->getControllableEntity());
+
+ myDrone->moveFrontBack(100*dt);
+ myDrone->moveUpDown(100*dt);
+ // 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: branches/tutorial/src/orxonox/objects/controllers/DroneController.cc_aJaggi
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/buildsystem/src/orxonox/objects/controllers/DroneController.cc:1875-2277,2279-2401
/branches/buildsystem2/src/orxonox/objects/controllers/DroneController.cc:2507-2659
/branches/buildsystem3/src/orxonox/objects/controllers/DroneController.cc:2663-2709
/branches/ceguilua/src/orxonox/objects/controllers/DroneController.cc:1803-1809
/branches/core3/src/orxonox/objects/controllers/DroneController.cc:1573-1740
/branches/gcc43/src/orxonox/objects/controllers/DroneController.cc:1581
/branches/gui/src/orxonox/objects/controllers/DroneController.cc:1636-1724
/branches/input/src/orxonox/objects/controllers/DroneController.cc:1630-1637
/branches/lodfinal/src/orxonox/objects/controllers/DroneController.cc:2373-2412
/branches/network/src/orxonox/objects/controllers/DroneController.cc:2357
/branches/network64/src/orxonox/objects/controllers/DroneController.cc:2211-2356
/branches/objecthierarchy/src/orxonox/objects/controllers/DroneController.cc:1912-2086,2101,2111-2170
/branches/objecthierarchy2/src/orxonox/objects/controllers/DroneController.cc:2172-2480
/branches/overlay/src/orxonox/objects/controllers/DroneController.cc:2118-2386
/branches/physics/src/orxonox/objects/controllers/DroneController.cc:1913-2056,2108-2440
/branches/physics_merge/src/orxonox/objects/controllers/DroneController.cc:2437-2458
/branches/pickups/src/orxonox/objects/controllers/DroneController.cc:1927-2087,2128
/branches/pickups2/src/orxonox/objects/controllers/DroneController.cc:2108-2498
/branches/presentation/src/orxonox/objects/controllers/DroneController.cc:2370-2653,2655-2661
/branches/questsystem/src/orxonox/objects/controllers/DroneController.cc:1895-2089
/branches/questsystem2/src/orxonox/objects/controllers/DroneController.cc:2108-2260
/branches/script_trigger/src/orxonox/objects/controllers/DroneController.cc:1296-1954,1956
/branches/weapon/src/orxonox/objects/controllers/DroneController.cc:1926-2095
/branches/weapon2/src/orxonox/objects/controllers/DroneController.cc:2108-2489
More information about the Orxonox-commit
mailing list