public static boolean approximateEquals(float a, float b) {
        if (a == b) {
            return true;
        } else {
            return (abs(a - b) / Math.max(abs(a), abs(b))) <= 0.00001f;
        }
    }
Determine if two floats are approximately equal.
This takes into account the magnitude of the floats, since
large numbers will have larger differences be close to each other.

Should return true for a=100000, b=100001, but false for a=10000, b=10001.

@param a The first float to compare
@param b The second float to compare
@return True if a and b are approximately equal, false otherwise.
jme3-core/src/main/java/com/jme3/math/FastMath.java