Browse Source

Increase object snapping distances in the 3D editor

- Increase drag-and-drop snapping to 50 units
  (from 10 units).
- Increase Snap Object to Floor maximum height to 500 units
  (from 20 units).
- Increase Snap Object to Floor negative margin to 1 unit
  (from 0.2 units).

(cherry picked from commit 7a3d0b79b4199aa3bf261155385c4d71c80a139c)
Hugo Locurcio 3 years ago
parent
commit
52b16f0984
1 changed files with 3 additions and 3 deletions
  1. 3 3
      editor/plugins/spatial_editor_plugin.cpp

+ 3 - 3
editor/plugins/spatial_editor_plugin.cpp

@@ -3540,7 +3540,7 @@ void SpatialEditorViewport::assign_pending_data_pointers(Spatial *p_preview_node
 }
 }
 
 
 Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const {
 Vector3 SpatialEditorViewport::_get_instance_position(const Point2 &p_pos) const {
-	const float MAX_DISTANCE = 10;
+	const float MAX_DISTANCE = 50.0;
 
 
 	Vector3 world_ray = _get_ray(p_pos);
 	Vector3 world_ray = _get_ray(p_pos);
 	Vector3 world_pos = _get_ray_pos(p_pos);
 	Vector3 world_pos = _get_ray_pos(p_pos);
@@ -5972,7 +5972,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
 			// We add a bit of margin to the from position to avoid it from snapping
 			// We add a bit of margin to the from position to avoid it from snapping
 			// when the spatial is already on a floor and there's another floor under
 			// when the spatial is already on a floor and there's another floor under
 			// it
 			// it
-			from = from + Vector3(0.0, 0.2, 0.0);
+			from = from + Vector3(0.0, 1, 0.0);
 
 
 			Dictionary d;
 			Dictionary d;
 
 
@@ -5988,7 +5988,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() {
 	Array keys = snap_data.keys();
 	Array keys = snap_data.keys();
 
 
 	// The maximum height an object can travel to be snapped
 	// The maximum height an object can travel to be snapped
-	const float max_snap_height = 20.0;
+	const float max_snap_height = 500.0;
 
 
 	// Will be set to `true` if at least one node from the selection was successfully snapped
 	// Will be set to `true` if at least one node from the selection was successfully snapped
 	bool snapped_to_floor = false;
 	bool snapped_to_floor = false;