diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-15 19:27:03 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-15 19:27:03 +0300 |
commit | a9f023e226389461b1140f80e62f650d009a06a5 (patch) | |
tree | 2d3b860bf5d5996e77b102673bd0cbaef4d15f26 /source/blender/blenkernel/intern/type_conversions.cc | |
parent | 3ed3ee253b12fe4d481357386650a13de244caf9 (diff) |
BLI: Change dependencies in vector math files
This patch reverses the dependency between `BLI_math_vec_types.hh` and
`BLI_math_vector.hh`. Now the higher level `blender::math` functions
depend on the header that defines the types they work with, rather than
the other way around.
The initial goal was to allow defining an `enable_if` in the types header
and using it in the math header. But I also think this operations to types
dependency is more natural anyway.
This required changing the includes some files used from the type
header to the math implementation header. I took that change a bit
further removing the C vector math header from the C++ header;
I think that helps to make the transition between the two systems
clearer.
Differential Revision: https://developer.blender.org/D14112
Diffstat (limited to 'source/blender/blenkernel/intern/type_conversions.cc')
-rw-r--r-- | source/blender/blenkernel/intern/type_conversions.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/type_conversions.cc b/source/blender/blenkernel/intern/type_conversions.cc index 4ab945d14c6..2e8b5b3433b 100644 --- a/source/blender/blenkernel/intern/type_conversions.cc +++ b/source/blender/blenkernel/intern/type_conversions.cc @@ -5,7 +5,7 @@ #include "FN_multi_function_builder.hh" #include "BLI_color.hh" -#include "BLI_math_vec_types.hh" +#include "BLI_math_vector.hh" namespace blender::bke { @@ -72,7 +72,7 @@ static int float2_to_int(const float2 &a) } static bool float2_to_bool(const float2 &a) { - return !is_zero_v2(a); + return !math::is_zero(a); } static int8_t float2_to_int8(const float2 &a) { @@ -85,7 +85,7 @@ static ColorGeometry4f float2_to_color(const float2 &a) static bool float3_to_bool(const float3 &a) { - return !is_zero_v3(a); + return !math::is_zero(a); } static int8_t float3_to_int8(const float3 &a) { |