diff options
Diffstat (limited to 'source/blender/nodes/function')
3 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/nodes/function/node_function_util.hh b/source/blender/nodes/function/node_function_util.hh index acde9c4b55b..69c617b4f01 100644 --- a/source/blender/nodes/function/node_function_util.hh +++ b/source/blender/nodes/function/node_function_util.hh @@ -18,7 +18,7 @@ #include <string.h> -#include "BLI_float3.hh" +#include "BLI_math_vec_types.hh" #include "BLI_utildefines.h" #include "MEM_guardedalloc.h" diff --git a/source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc b/source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc index f4ce8d2f35a..bcc035e6ede 100644 --- a/source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc +++ b/source/blender/nodes/function/nodes/node_fn_align_euler_to_vector.cc @@ -69,14 +69,14 @@ static void align_rotations_auto_pivot(IndexMask mask, float3 old_axis; mul_v3_m3v3(old_axis, old_rotation, local_main_axis); - const float3 new_axis = vector.normalized(); - float3 rotation_axis = float3::cross_high_precision(old_axis, new_axis); + const float3 new_axis = math::normalize(vector); + float3 rotation_axis = math::cross_high_precision(old_axis, new_axis); if (is_zero_v3(rotation_axis)) { /* The vectors are linearly dependent, so we fall back to another axis. */ - rotation_axis = float3::cross_high_precision(old_axis, float3(1, 0, 0)); + rotation_axis = math::cross_high_precision(old_axis, float3(1, 0, 0)); if (is_zero_v3(rotation_axis)) { /* This is now guaranteed to not be zero. */ - rotation_axis = float3::cross_high_precision(old_axis, float3(0, 1, 0)); + rotation_axis = math::cross_high_precision(old_axis, float3(0, 1, 0)); } } diff --git a/source/blender/nodes/function/nodes/node_fn_compare.cc b/source/blender/nodes/function/nodes/node_fn_compare.cc index 3bb46511eeb..7c09bace756 100644 --- a/source/blender/nodes/function/nodes/node_fn_compare.cc +++ b/source/blender/nodes/function/nodes/node_fn_compare.cc @@ -265,7 +265,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_DOT_PRODUCT: { static fn::CustomMF_SI_SI_SI_SO<float3, float3, float, bool> fn{ "Less Than - Dot Product", - [](float3 a, float3 b, float comp) { return float3::dot(a, b) < comp; }}; + [](float3 a, float3 b, float comp) { return math::dot(a, b) < comp; }}; return &fn; } case NODE_COMPARE_MODE_DIRECTION: { @@ -283,7 +283,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_LENGTH: { static fn::CustomMF_SI_SI_SO<float3, float3, bool> fn{ "Less Than - Length", - [](float3 a, float3 b) { return a.length() < b.length(); }}; + [](float3 a, float3 b) { return math::length(a) < math::length(b); }}; return &fn; } } @@ -299,7 +299,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_DOT_PRODUCT: { static fn::CustomMF_SI_SI_SI_SO<float3, float3, float, bool> fn{ "Less Equal - Dot Product", - [](float3 a, float3 b, float comp) { return float3::dot(a, b) <= comp; }}; + [](float3 a, float3 b, float comp) { return math::dot(a, b) <= comp; }}; return &fn; } case NODE_COMPARE_MODE_DIRECTION: { @@ -317,7 +317,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_LENGTH: { static fn::CustomMF_SI_SI_SO<float3, float3, bool> fn{ "Less Equal - Length", - [](float3 a, float3 b) { return a.length() <= b.length(); }}; + [](float3 a, float3 b) { return math::length(a) <= math::length(b); }}; return &fn; } } @@ -333,7 +333,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_DOT_PRODUCT: { static fn::CustomMF_SI_SI_SI_SO<float3, float3, float, bool> fn{ "Greater Than - Dot Product", - [](float3 a, float3 b, float comp) { return float3::dot(a, b) > comp; }}; + [](float3 a, float3 b, float comp) { return math::dot(a, b) > comp; }}; return &fn; } case NODE_COMPARE_MODE_DIRECTION: { @@ -351,7 +351,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_LENGTH: { static fn::CustomMF_SI_SI_SO<float3, float3, bool> fn{ "Greater Than - Length", - [](float3 a, float3 b) { return a.length() > b.length(); }}; + [](float3 a, float3 b) { return math::length(a) > math::length(b); }}; return &fn; } } @@ -367,7 +367,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_DOT_PRODUCT: { static fn::CustomMF_SI_SI_SI_SO<float3, float3, float, bool> fn{ "Greater Equal - Dot Product", - [](float3 a, float3 b, float comp) { return float3::dot(a, b) >= comp; }}; + [](float3 a, float3 b, float comp) { return math::dot(a, b) >= comp; }}; return &fn; } case NODE_COMPARE_MODE_DIRECTION: { @@ -385,7 +385,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_LENGTH: { static fn::CustomMF_SI_SI_SO<float3, float3, bool> fn{ "Greater Equal - Length", - [](float3 a, float3 b) { return a.length() >= b.length(); }}; + [](float3 a, float3 b) { return math::length(a) >= math::length(b); }}; return &fn; } } @@ -402,7 +402,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_DOT_PRODUCT: { static fn::CustomMF_SI_SI_SI_SI_SO<float3, float3, float, float, bool> fn{ "Equal - Dot Product", [](float3 a, float3 b, float comp, float epsilon) { - return abs(float3::dot(a, b) - comp) <= epsilon; + return abs(math::dot(a, b) - comp) <= epsilon; }}; return &fn; } @@ -424,7 +424,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_LENGTH: { static fn::CustomMF_SI_SI_SI_SO<float3, float3, float, bool> fn{ "Equal - Length", [](float3 a, float3 b, float epsilon) { - return abs(a.length() - b.length()) <= epsilon; + return abs(math::length(a) - math::length(b)) <= epsilon; }}; return &fn; } @@ -442,7 +442,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_DOT_PRODUCT: { static fn::CustomMF_SI_SI_SI_SI_SO<float3, float3, float, float, bool> fn{ "Not Equal - Dot Product", [](float3 a, float3 b, float comp, float epsilon) { - return abs(float3::dot(a, b) - comp) >= epsilon; + return abs(math::dot(a, b) - comp) >= epsilon; }}; return &fn; } @@ -464,7 +464,7 @@ static const fn::MultiFunction *get_multi_function(bNode &node) case NODE_COMPARE_MODE_LENGTH: { static fn::CustomMF_SI_SI_SI_SO<float3, float3, float, bool> fn{ "Not Equal - Length", [](float3 a, float3 b, float epsilon) { - return abs(a.length() - b.length()) > epsilon; + return abs(math::length(a) - math::length(b)) > epsilon; }}; return &fn; } |