From 34c979bd02917d73da4cb21eb65a87df6562acc7 Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Wed, 14 Feb 2007 04:12:32 +0000 Subject: [PATCH] double precision mode uses double precision epsilons/maximum (DBL_EPSILON instead of FLT_EPSILON) --- src/LinearMath/btScalar.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/LinearMath/btScalar.h b/src/LinearMath/btScalar.h index 499202d75..ef99310e8 100644 --- a/src/LinearMath/btScalar.h +++ b/src/LinearMath/btScalar.h @@ -104,8 +104,14 @@ SIMD_FORCE_INLINE btScalar btPow(btScalar x,btScalar y) { return powf(x,y); } #define SIMD_HALF_PI (SIMD_2_PI * btScalar(0.25)) #define SIMD_RADS_PER_DEG (SIMD_2_PI / btScalar(360.0)) #define SIMD_DEGS_PER_RAD (btScalar(360.0) / SIMD_2_PI) + +#ifdef BT_USE_DOUBLE_PRECISION +#define SIMD_EPSILON DBL_EPSILON +#define SIMD_INFINITY DBL_MAX +#else #define SIMD_EPSILON FLT_EPSILON #define SIMD_INFINITY FLT_MAX +#endif SIMD_FORCE_INLINE bool btFuzzyZero(btScalar x) { return btFabs(x) < SIMD_EPSILON; }