public static float copysign(float x, float y) {
        if (y >= 0 && x <= -0) {
            return -x;
        } else if (y < 0 && x >= 0) {
            return -x;
        } else {
            return x;
        }
    }
@param x   the value whose sign is to be adjusted.
@param y   the value whose sign is to be used.
@return x with its sign changed to match the sign of y.
jme3-core/src/main/java/com/jme3/math/FastMath.java