@@ -0,0 +1,2293 @@
+package com.edinarobotics.utils.gamepad.filters;%0A%0Aimport com.edinarobotics.utils.gamepad.GamepadFilter;%0Aimport com.edinarobotics.utils.gamepad.GamepadResult;%0Aimport com.sun.squawk.util.MathUtils;%0A%0A/**%0A * Implements a gamepad joystick filter that raises the value of all axes%0A * to a given power. Regardless of the value of this power, this filter%0A * preserves the sign of the joystick value (a negative joystick value%0A * will still be negative after this filter is applied).%0A */%0Apublic class ScalingPowerFilter implements GamepadFilter%7B%0A    private int power;%0A    %0A    /**%0A     * Constructs a new ScalingPowerFilter that will raise the value of all%0A     * gamepad axes to the given %7B@code power%7D.%0A     * @param power The power to which all gamepad axis values will be raised.%0A     */%0A    public ScalingPowerFilter(int power)%7B%0A        this.power = power;%0A    %7D%0A    %0A    /**%0A     * Applies this filter to the given GamepadResult.%0A     * @param toFilter The GamepadResult to which this filter is to be applied.%0A     * @return A new GamepadResult that is equivalent to %7B@code toFilter%7D after%0A     * this filter is applied.%0A     */%0A    public GamepadResult filter(GamepadResult toFilter)%7B%0A        return new GamepadResult(filter(toFilter.getLeftX()),%0A                filter(toFilter.getLeftY()),%0A                filter(toFilter.getRightX()),%0A                filter(toFilter.getRightY()));%0A    %7D%0A    %0A    /**%0A     * Internal function used to apply the filter value to %7B@code double%7D%0A     * values. Raises the given value to the specified power,%0A     * takes takes the absolute value of the result and multiplies that%0A     * value by the sign of the original value.%0A     * @param value The %7B@code double%7D that is to be filtered.%0A     * @return A double with this filter operation applied to it.%0A     */%0A    private double filter(double value)%7B%0A        return signum(value)*Math.abs(MathUtils.pow(value, power));%0A    %7D%0A    /**%0A     * Internal signum function. Returns the sign of the given value as a byte.%0A     * @param value The value whose sign is to be returned.%0A     * @return The sign of the given value.%0A     */%0A    private byte signum(double value)%7B%0A        if(value %3E 0)%7B%0A            return 1;%0A        %7D%0A        else if(value %3C 0)%7B%0A            return -1;%0A        %7D%0A        return 0;%0A    %7D%0A%0A%7D%0A

Add ScalingPowerFilter to the project.