summaryrefslogtreecommitdiffstats
path: root/core/math/math_defs.h
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2019-02-25 21:46:24 -0300
committerJuan Linietsky <juan@godotengine.org>2019-02-25 21:47:29 -0300
commita32b26dfa26f2a039bf9c84b90d10666bcf785c9 (patch)
tree71ba0cf141b34b242edbe39f266ef36d6054a761 /core/math/math_defs.h
parent51c1d55cf9089cefbde034893b4784a5d554ddcc (diff)
downloadredot-engine-a32b26dfa26f2a039bf9c84b90d10666bcf785c9.tar.gz
Several fixes to make GLES2 on HTML5 work much better.
Changed math class error reporting to be a bit less paranoid.
Diffstat (limited to 'core/math/math_defs.h')
-rw-r--r--core/math/math_defs.h9
1 files changed, 9 insertions, 0 deletions
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 {