You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Do nothing when dragging CSGBox handle perpendicular to the camera
(cherry picked from commit 0f1e107ede)
This commit is contained in:
committed by
Rémi Verschelde
parent
6878fe6d88
commit
121af4a37d
@@ -149,6 +149,12 @@ void CSGShapeSpatialGizmoPlugin::set_handle(EditorSpatialGizmo *p_gizmo, int p_i
|
|||||||
Vector3 ra, rb;
|
Vector3 ra, rb;
|
||||||
Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb);
|
Geometry::get_closest_points_between_segments(Vector3(), axis * 4096, sg[0], sg[1], ra, rb);
|
||||||
float d = ra[p_idx];
|
float d = ra[p_idx];
|
||||||
|
|
||||||
|
if (Math::is_nan(d)) {
|
||||||
|
// The handle is perpendicular to the camera.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (SpatialEditor::get_singleton()->is_snap_enabled()) {
|
if (SpatialEditor::get_singleton()->is_snap_enabled()) {
|
||||||
d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
|
d = Math::stepify(d, SpatialEditor::get_singleton()->get_translate_snap());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user