Improve Navigation2D default settings, fixes #56852

This commit reduces `cell_size` and `edge_connection_margin` default
values so that `Navigation2D` behaves more like in Godot <= `3.4` by default.
This commit is contained in:
Pawel Lampe 2022-01-23 13:52:15 +01:00
parent e33f8df9ca
commit 67cf622935
2 changed files with 4 additions and 4 deletions

View file

@ -41,10 +41,10 @@
</method>
</methods>
<members>
<member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="10.0">
<member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="1.0">
The XY plane cell size to use for fields.
</member>
<member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="100.0">
<member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="1.0">
This value is used to detect the near edges to connect compatible regions.
</member>
</members>

View file

@ -84,8 +84,8 @@ RID Navigation2D::get_closest_point_owner(const Vector2 &p_point) const {
Navigation2D::Navigation2D() {
map = Navigation2DServer::get_singleton()->map_create();
set_cell_size(10); // Ten pixels
set_edge_connection_margin(100);
set_cell_size(1); // One pixel
set_edge_connection_margin(1);
}
Navigation2D::~Navigation2D() {