summaryrefslogtreecommitdiff
path: root/scene/animation/animation_blend_space_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/animation/animation_blend_space_2d.cpp')
-rw-r--r--scene/animation/animation_blend_space_2d.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp
index 1fe14e633b..95d4644004 100644
--- a/scene/animation/animation_blend_space_2d.cpp
+++ b/scene/animation/animation_blend_space_2d.cpp
@@ -461,9 +461,9 @@ float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) {
points[j],
points[(j + 1) % 3]
};
- Vector2 closest = Geometry::get_closest_point_to_segment_2d(blend_pos, s);
- if (first || closest.distance_to(blend_pos) < best_point.distance_to(blend_pos)) {
- best_point = closest;
+ Vector2 closest2 = Geometry::get_closest_point_to_segment_2d(blend_pos, s);
+ if (first || closest2.distance_to(blend_pos) < best_point.distance_to(blend_pos)) {
+ best_point = closest2;
blend_triangle = i;
first = false;
float d = s[0].distance_to(s[1]);
@@ -472,7 +472,7 @@ float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) {
blend_weights[(j + 1) % 3] = 0.0;
blend_weights[(j + 2) % 3] = 0.0;
} else {
- float c = s[0].distance_to(closest) / d;
+ float c = s[0].distance_to(closest2) / d;
blend_weights[j] = 1.0 - c;
blend_weights[(j + 1) % 3] = c;