diff options
author | Bastien Montagne <bastien@blender.org> | 2021-06-14 12:06:35 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-06-14 13:32:38 +0300 |
commit | b21db5e6988566dc3344b3293eb7e33234ec2597 (patch) | |
tree | 0bc664e2dfb2dce5b94062367ba54bc14eacb9bf /source/blender/blenlib/BLI_math_vector.h | |
parent | 5add6f2ed93773e1231e3d52dc9fd963b3bfb9e7 (diff) |
BLI_math: Fix several division-by-zero cases.
Those were caused by various tools used on degenerate geometry, see
T79775.
Note that fixes are as low-level as possible, to ensure they cover as
much as possible of unreported issues too.
We still probably have many more of those hidden in BLI_math though.
Diffstat (limited to 'source/blender/blenlib/BLI_math_vector.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index b43f86af670..caedf83666f 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -327,6 +327,10 @@ MINLINE bool is_zero_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT; MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT; MINLINE bool is_zero_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT; +MINLINE bool is_zero_v2_db(const double a[2]) ATTR_WARN_UNUSED_RESULT; +MINLINE bool is_zero_v3_db(const double a[3]) ATTR_WARN_UNUSED_RESULT; +MINLINE bool is_zero_v4_db(const double a[4]) ATTR_WARN_UNUSED_RESULT; + bool is_finite_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT; bool is_finite_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT; bool is_finite_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT; |