diff options
author | Bastien Montagne <bastien@blender.org> | 2021-06-14 13:30:11 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-06-14 13:32:38 +0300 |
commit | 748475b9431c5b09514b69b042f0daaea1231dc1 (patch) | |
tree | 935b5661487a1603f2811ed8a5b38fe2747c4099 /source/blender/blenlib/BLI_math_base.h | |
parent | b21db5e6988566dc3344b3293eb7e33234ec2597 (diff) |
BLI_math: Cleanup: Use `mul_`/`madd_` functions.
Better to avoid explicit vectors components direct manipulation when a
generic operation for whole vector exists, if nothing else it avoids
potential mistakes in indices.
Diffstat (limited to 'source/blender/blenlib/BLI_math_base.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_base.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index 46219ad5493..5a3482db046 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -237,6 +237,7 @@ float ceil_power_of_10(float f); #ifndef NDEBUG /** \note 0.0001 is too small because normals may be converted from short's: see T34322. */ # define BLI_ASSERT_UNIT_EPSILON 0.0002f +# define BLI_ASSERT_UNIT_EPSILON_DB 0.0002 /** * \note Checks are flipped so NAN doesn't assert. * This is done because we're making sure the value was normalized and in the case we @@ -253,8 +254,8 @@ float ceil_power_of_10(float f); # define BLI_ASSERT_UNIT_V3_DB(v) \ { \ const double _test_unit = len_squared_v3_db(v); \ - BLI_assert(!(fabs(_test_unit - 1.0) >= BLI_ASSERT_UNIT_EPSILON) || \ - !(fabs(_test_unit) >= BLI_ASSERT_UNIT_EPSILON)); \ + BLI_assert(!(fabs(_test_unit - 1.0) >= BLI_ASSERT_UNIT_EPSILON_DB) || \ + !(fabs(_test_unit) >= BLI_ASSERT_UNIT_EPSILON_DB)); \ } \ (void)0 |