This is the code from btScalar.h.
Code: Select all
SIMD_FORCE_INLINE bool btEqual(btScalar a, btScalar eps) {
return (((a) <= eps) && !((a) < -eps));
}
I was using it to compare 29.53 and 31.04.
a <= eps returns true since 29.53 is less than or equal to 31.04.
a < -eps returns false since 29.53 is not less than -31.04. Then there's the not operator, turning this into true. This in effect returns true for 29.53 being equal to 31.04.
I'm really confused as to how this function is supposed to be used. I'd understand if it took btSclar a, btScalar b, then btScalar eps for the epsilon between them or something.
Before I actually looked at its code I assumed it worked something like
Code: Select all
btFuzzyZero(a - b);