Browse Source

Allow the caller to override the axis' default dead
zone configured at startup.

Paul Speed 10 years ago
parent
commit
46794e251d
1 changed files with 8 additions and 0 deletions
  1. 8 0
      jme3-core/src/main/java/com/jme3/input/DefaultJoystickAxis.java

+ 8 - 0
jme3-core/src/main/java/com/jme3/input/DefaultJoystickAxis.java

@@ -135,6 +135,14 @@ public class DefaultJoystickAxis implements JoystickAxis {
         return deadZone;
         return deadZone;
     }        
     }        
 
 
+    /**
+     *  Sets/overrides the dead zone for this axis.  This indicates that values
+     *  within +/- deadZone should be ignored.
+     */
+    public void setDeadZone( float f ) {
+        this.deadZone = f;
+    }     
+
     @Override
     @Override
     public String toString(){
     public String toString(){
         return "JoystickAxis[name=" + name + ", parent=" + parent.getName() + ", id=" + axisIndex 
         return "JoystickAxis[name=" + name + ", parent=" + parent.getName() + ", id=" + axisIndex