From a32b26dfa26f2a039bf9c84b90d10666bcf785c9 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 25 Feb 2019 21:46:24 -0300 Subject: Several fixes to make GLES2 on HTML5 work much better. Changed math class error reporting to be a bit less paranoid. --- core/math/math_defs.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/math/math_defs.h') diff --git a/core/math/math_defs.h b/core/math/math_defs.h index 48533ba659..c54d3cc96f 100644 --- a/core/math/math_defs.h +++ b/core/math/math_defs.h @@ -33,6 +33,7 @@ #define CMP_EPSILON 0.00001 #define CMP_EPSILON2 (CMP_EPSILON * CMP_EPSILON) + #define CMP_NORMALIZE_TOLERANCE 0.000001 #define CMP_POINT_IN_PLANE_EPSILON 0.00001 @@ -49,6 +50,14 @@ #define MATH_CHECKS #endif +//this epsilon is for values related to a unit size (scalar or vector len) +#ifdef PRECISE_MATH_CHECKS +#define UNIT_EPSILON 0.00001 +#else +//tolerate some more floating point error normally +#define UNIT_EPSILON 0.001 +#endif + #define USEC_TO_SEC(m_usec) ((m_usec) / 1000000.0) enum ClockDirection { -- cgit v1.2.3