diff options
author | Hans Goudey <h.goudey@me.com> | 2021-06-09 07:52:29 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-06-09 07:52:29 +0300 |
commit | 8c3f4f7edf9d9769f07291d64bc22fa85e210e86 (patch) | |
tree | 5f55f6486d0a4dac34ec2244904cdaa42a1ce669 | |
parent | 307f8c8e76b37d0287d5dc18e1b1fd047299cadd (diff) |
Fix: Incorrect node bezier spline tangent calculation for end points
The code was using the useless dangling handle at each end of the spline
rather than the handle pointing inwards.
-rw-r--r-- | source/blender/blenkernel/intern/spline_bezier.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/spline_bezier.cc b/source/blender/blenkernel/intern/spline_bezier.cc index 3c6cf2c78cf..3e421dcfc13 100644 --- a/source/blender/blenkernel/intern/spline_bezier.cc +++ b/source/blender/blenkernel/intern/spline_bezier.cc @@ -317,11 +317,11 @@ void BezierSpline::correct_end_tangents() const MutableSpan<float3> tangents(evaluated_tangents_cache_); - if (handle_positions_left_.first() != positions_.first()) { - tangents.first() = (positions_.first() - handle_positions_left_.first()).normalized(); + if (handle_positions_right_.first() != positions_.first()) { + tangents.first() = (handle_positions_right_.first() - positions_.first()).normalized(); } - if (handle_positions_right_.last() != positions_.last()) { - tangents.last() = (handle_positions_right_.last() - positions_.last()).normalized(); + if (handle_positions_left_.last() != positions_.last()) { + tangents.last() = (positions_.last() - handle_positions_left_.last()).normalized(); } } |