diff options
author | Yaohua Xiong <xiongyaohua@gmail.com> | 2022-12-07 23:37:59 +0800 |
---|---|---|
committer | Yaohua Xiong <xiongyaohua@gmail.com> | 2022-12-14 08:52:14 +0800 |
commit | adeef12b12a9852ec24fa06a145655524816145f (patch) | |
tree | 9ee873c2628075f8b7c5c11f3de965d4fbbd014d /editor/plugins | |
parent | db6976eed4c59b3a320cb26938898c732ef6b7ca (diff) |
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.
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/path_3d_editor_plugin.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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); |