[Orxonox-commit 1642] r6360 - in code/branches/presentation2/src: libraries/core/input orxonox/controllers

rgrieder at orxonox.net rgrieder at orxonox.net
Wed Dec 16 11:20:58 CET 2009


Author: rgrieder
Date: 2009-12-16 11:20:57 +0100 (Wed, 16 Dec 2009)
New Revision: 6360

Modified:
   code/branches/presentation2/src/libraries/core/input/KeyBinder.cc
   code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc
Log:
Fixed cursor behaviour when steering with a gamepad.

Modified: code/branches/presentation2/src/libraries/core/input/KeyBinder.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/input/KeyBinder.cc	2009-12-15 23:23:37 UTC (rev 6359)
+++ code/branches/presentation2/src/libraries/core/input/KeyBinder.cc	2009-12-16 10:20:57 UTC (rev 6360)
@@ -479,10 +479,7 @@
         }
 
         // these are the actually useful axis bindings for analog input
-        if (!bFilterAnalogNoise_ || halfAxis.relVal_ > analogThreshold_ || halfAxis.absVal_ > analogThreshold_)
-        {
-            halfAxis.execute();
-        }
+        halfAxis.execute();
     }
 
     /**
@@ -558,6 +555,9 @@
 
     void KeyBinder::axisMoved(unsigned int device, unsigned int axisID, float value)
     {
+        // Filter analog noise
+        if (this->bFilterAnalogNoise_ && std::abs(value) < this->analogThreshold_)
+            value = 0.0;
         int i = axisID * 2;
         JoyStickAxisVector& axis = *joyStickAxes_[device];
         if (value < 0)

Modified: code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc
===================================================================
--- code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc	2009-12-15 23:23:37 UTC (rev 6359)
+++ code/branches/presentation2/src/orxonox/controllers/NewHumanController.cc	2009-12-16 10:20:57 UTC (rev 6360)
@@ -256,6 +256,10 @@
             }
         }
 
+        // Reset pitch and yaw rates
+        this->currentPitch_ = 0;
+        this->currentYaw_ = 0;
+
         HumanController::tick(dt);
     }
 




More information about the Orxonox-commit mailing list