[Curve3D] Fix middle point forward vector when control1=end and control2=begin; issue #88923
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
This commit is contained in:
@@ -899,6 +899,10 @@ Vector2 Curve2D::_calculate_tangent(const Vector2 &p_begin, const Vector2 &p_con
|
||||
}
|
||||
}
|
||||
|
||||
if (p_control_1.is_equal_approx(p_end) && p_control_2.is_equal_approx(p_begin)) {
|
||||
return (p_end - p_begin).normalized();
|
||||
}
|
||||
|
||||
return p_begin.bezier_derivative(p_control_1, p_control_2, p_end, p_t).normalized();
|
||||
}
|
||||
|
||||
@@ -1648,6 +1652,10 @@ Vector3 Curve3D::_calculate_tangent(const Vector3 &p_begin, const Vector3 &p_con
|
||||
}
|
||||
}
|
||||
|
||||
if (p_control_1.is_equal_approx(p_end) && p_control_2.is_equal_approx(p_begin)) {
|
||||
return (p_end - p_begin).normalized();
|
||||
}
|
||||
|
||||
return p_begin.bezier_derivative(p_control_1, p_control_2, p_end, p_t).normalized();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user