From d00f78f8591357c5407c346ea6df5e3a67b100fc Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 1 Dec 2014 22:27:02 -0800 Subject: [PATCH] Revert square to circle analog work since it seems to be handled correctly already --- .../binding/input/ControllerHandler.java | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/app/src/main/java/com/limelight/binding/input/ControllerHandler.java b/app/src/main/java/com/limelight/binding/input/ControllerHandler.java index 018b4477..3b7fb54d 100644 --- a/app/src/main/java/com/limelight/binding/input/ControllerHandler.java +++ b/app/src/main/java/com/limelight/binding/input/ControllerHandler.java @@ -396,37 +396,12 @@ public class ControllerHandler { // evaluates the deadzone. } - private void handleAnalogStickPlaneMapping(ControllerMapping mapping, Vector2d stickVector) { - if (!mapping.squareAnalogStick) { - // If the stick vector's magnitude exceeds 1.0 (1.1 to be safe), that means - // that the stick isn't behaving like a circular analog stick but like a square - if (stickVector.getMagnitude() > 1.1f) { - mapping.squareAnalogStick = true; - LimeLog.info("Switching to square analog stick mode"); - } - } - - if (mapping.squareAnalogStick) { - double xSquare = stickVector.getX(); - double ySquare = stickVector.getY(); - - // Scale the vector from the square stick to the circular range - stickVector.initialize( - (float)(xSquare * Math.sqrt(1.0 - 0.5*Math.abs(ySquare))), - (float)(ySquare * Math.sqrt(1.0 - 0.5*Math.abs(xSquare)))); - } - } - private void handleAxisSet(ControllerMapping mapping, float lsX, float lsY, float rsX, float rsY, float lt, float rt, float hatX, float hatY) { if (mapping.leftStickXAxis != -1 && mapping.leftStickYAxis != -1) { Vector2d leftStickVector = populateCachedVector(lsX, lsY); - // Map to the circular plane before applying the deadzone to ensure - // the effective deadzone area isn't skewed by the transformation - handleAnalogStickPlaneMapping(mapping, leftStickVector); - handleDeadZone(leftStickVector, mapping.leftStickDeadzoneRadius); leftStickX = (short) (leftStickVector.getX() * 0x7FFE); @@ -436,10 +411,6 @@ public class ControllerHandler { if (mapping.rightStickXAxis != -1 && mapping.rightStickYAxis != -1) { Vector2d rightStickVector = populateCachedVector(rsX, rsY); - // Map to the circular plane before applying the deadzone to ensure - // the effective deadzone area isn't skewed by the transformation - handleAnalogStickPlaneMapping(mapping, rightStickVector); - handleDeadZone(rightStickVector, mapping.rightStickDeadzoneRadius); rightStickX = (short) (rightStickVector.getX() * 0x7FFE); @@ -756,9 +727,5 @@ public class ControllerHandler { public boolean backIsStart; public boolean isRemote; public boolean hasJoystickAxes; - - // XInput uses a rounded analog stick where (1.0, 1.0) -> (2^(1/2), 2^(1/2)) - // Some controllers have square sticks which we will map onto the circular plane - public boolean squareAnalogStick; } }