From adeef12b12a9852ec24fa06a145655524816145f Mon Sep 17 00:00:00 2001 From: Yaohua Xiong Date: Wed, 7 Dec 2022 23:37:59 +0800 Subject: Handle corner cases for curve baking When control point and point have equal position, the derivative is 0 vector, which cause error message in Basis::look_at(). This commit handles this case. --- editor/plugins/path_3d_editor_plugin.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'editor') diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 63ca78d6c0..7a9e50e482 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -274,13 +274,10 @@ void Path3DGizmo::redraw() { // Fish Bone. v3p.push_back(p1); - v3p.push_back(p1 + (side - forward) * 0.06); + v3p.push_back(p1 + (side - forward + up * 0.3) * 0.06); v3p.push_back(p1); - v3p.push_back(p1 + (-side - forward) * 0.06); - - v3p.push_back(p1); - v3p.push_back(p1 + up * 0.03); + v3p.push_back(p1 + (-side - forward + up * 0.3) * 0.06); } add_lines(v3p, path_material); -- cgit v1.2.3