diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-21 11:16:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-21 11:16:19 +0200 |
commit | d4bbdb83674526a80ae6d0d2c080768da7629804 (patch) | |
tree | 9fbe5a4ba2bf8431b05845378ddaad6c07afc805 /scene/animation | |
parent | 8cc599db645a356ca6af3bc15e7574fa6e3ada0e (diff) | |
parent | 78b0a7da0398dc8c6447b1439a6d07059311c028 (diff) |
Merge pull request #50521 from aaronfranke/iseqapprox
Use `is_equal_approx` in more places
Diffstat (limited to 'scene/animation')
-rw-r--r-- | scene/animation/animation_blend_space_2d.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp index 6878cbaa12..d88a9badf4 100644 --- a/scene/animation/animation_blend_space_2d.cpp +++ b/scene/animation/animation_blend_space_2d.cpp @@ -387,19 +387,19 @@ Vector2 AnimationNodeBlendSpace2D::get_closest_point(const Vector2 &p_point) { } void AnimationNodeBlendSpace2D::_blend_triangle(const Vector2 &p_pos, const Vector2 *p_points, float *r_weights) { - if (p_pos.distance_squared_to(p_points[0]) < CMP_EPSILON2) { + if (p_pos.is_equal_approx(p_points[0])) { r_weights[0] = 1; r_weights[1] = 0; r_weights[2] = 0; return; } - if (p_pos.distance_squared_to(p_points[1]) < CMP_EPSILON2) { + if (p_pos.is_equal_approx(p_points[1])) { r_weights[0] = 0; r_weights[1] = 1; r_weights[2] = 0; return; } - if (p_pos.distance_squared_to(p_points[2]) < CMP_EPSILON2) { + if (p_pos.is_equal_approx(p_points[2])) { r_weights[0] = 0; r_weights[1] = 0; r_weights[2] = 1; |