[Orxonox-commit 1441] r6159 - code/branches/presentation2/src/orxonox/controllers

rgrieder at orxonox.net rgrieder at orxonox.net
Thu Nov 26 14:09:40 CET 2009


Author: rgrieder
Date: 2009-11-26 14:09:40 +0100 (Thu, 26 Nov 2009)
New Revision: 6159

Modified:
   code/branches/presentation2/src/orxonox/controllers/HumanController.cc
   code/branches/presentation2/src/orxonox/controllers/HumanController.h
Log:
Fixed bug in HumanController introduced with the virtual functions.

Modified: code/branches/presentation2/src/orxonox/controllers/HumanController.cc
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/HumanController.cc	2009-11-26 09:04:59 UTC (rev 6158)
+++ code/branches/presentation2/src/orxonox/controllers/HumanController.cc	2009-11-26 13:09:40 UTC (rev 6159)
@@ -94,6 +94,12 @@
         }
     }
 
+    void HumanController::moveFrontBack(const Vector2& value)
+    {
+        if (HumanController::localController_s)
+            HumanController::localController_s->frontback(value);
+    }
+
     void HumanController::frontback(const Vector2& value)
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
@@ -136,12 +142,30 @@
             HumanController::localController_s->controllableEntity_->rotatePitch(value);
     }
 
+    void HumanController::rotateYaw(const Vector2& value)
+    {
+        if (HumanController::localController_s)
+            HumanController::localController_s->yaw(value);
+    }
+
+    void HumanController::rotatePitch(const Vector2& value)
+    {
+        if (HumanController::localController_s)
+            HumanController::localController_s->pitch(value);
+    }
+
     void HumanController::rotateRoll(const Vector2& value)
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)
             HumanController::localController_s->controllableEntity_->rotateRoll(value);
     }
 
+    void HumanController::fire(unsigned int firemode)
+    {
+        if (HumanController::localController_s)
+            HumanController::localController_s->doFire(firemode);
+    }
+
     void HumanController::doFire(unsigned int firemode)
     {
         if (HumanController::localController_s && HumanController::localController_s->controllableEntity_)

Modified: code/branches/presentation2/src/orxonox/controllers/HumanController.h
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/HumanController.h	2009-11-26 09:04:59 UTC (rev 6158)
+++ code/branches/presentation2/src/orxonox/controllers/HumanController.h	2009-11-26 13:09:40 UTC (rev 6159)
@@ -44,19 +44,19 @@
 
             virtual void tick(float dt);
 
-            static void moveFrontBack(const Vector2& value){ HumanController::localController_s->frontback(value); }
+            static void moveFrontBack(const Vector2& value);
             static void moveRightLeft(const Vector2& value);
             static void moveUpDown(const Vector2& value);
 
-            static void rotateYaw(const Vector2& value){ HumanController::localController_s->yaw(value); }
-            static void rotatePitch(const Vector2& value){ HumanController::localController_s->pitch(value); }
+            static void rotateYaw(const Vector2& value);
+            static void rotatePitch(const Vector2& value);
             static void rotateRoll(const Vector2& value);
 
             virtual void frontback(const Vector2& value);
             virtual void yaw(const Vector2& value);
             virtual void pitch(const Vector2& value);
 
-            static void fire(unsigned int firemode) { HumanController::localController_s->doFire(firemode); }
+            static void fire(unsigned int firemode);
             virtual void doFire(unsigned int firemode);
             static void reload();
 




More information about the Orxonox-commit mailing list