diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-07-31 02:25:05 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2021-07-31 02:25:05 +0800 |
commit | 0f1e107ede5085aff017e8069697463598c5b512 (patch) | |
tree | 748abb71aede22e5227cc3db1ba7b2eb22028362 /modules/csg | |
parent | 1f6a81ceeac80ce95b5f686756c557b1be19a8b8 (diff) |
Do nothing when dragging CSGBox handle perpendicular to the camera
Diffstat (limited to 'modules/csg')
-rw-r--r-- | modules/csg/csg_gizmos.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/csg/csg_gizmos.cpp b/modules/csg/csg_gizmos.cpp index fc84c029ec..42f8b9f163 100644 --- a/modules/csg/csg_gizmos.cpp +++ b/modules/csg/csg_gizmos.cpp @@ -135,6 +135,12 @@ void CSGShape3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, int p_i Vector3 ra, rb; Geometry3D::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb); float d = ra[p_id]; + + if (Math::is_nan(d)) { + // The handle is perpendicular to the camera. + return; + } + if (Node3DEditor::get_singleton()->is_snap_enabled()) { d = Math::snapped(d, Node3DEditor::get_singleton()->get_translate_snap()); } |