1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

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.
This commit is contained in:
Yaohua Xiong
2022-12-07 23:37:59 +08:00
parent db6976eed4
commit adeef12b12
3 changed files with 36 additions and 11 deletions

View File

@@ -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);