Remove arbitrary NavigationMesh bake property limits
Lowers or removes the slider limits and steps from NavigationMesh resources and changes some default values to better work with realistic unit sizes by default.
(cherry picked from commit cda93057f7
)
This commit is contained in:
parent
809f4863fc
commit
b03f6bc170
2 changed files with 18 additions and 18 deletions
|
@ -74,25 +74,25 @@
|
|||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="agent/height" type="float" setter="set_agent_height" getter="get_agent_height" default="2.0">
|
||||
<member name="agent/height" type="float" setter="set_agent_height" getter="get_agent_height" default="1.5">
|
||||
The minimum floor to ceiling height that will still allow the floor area to be considered walkable.
|
||||
[b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell/height].
|
||||
</member>
|
||||
<member name="agent/max_climb" type="float" setter="set_agent_max_climb" getter="get_agent_max_climb" default="0.9">
|
||||
<member name="agent/max_climb" type="float" setter="set_agent_max_climb" getter="get_agent_max_climb" default="0.25">
|
||||
The minimum ledge height that is considered to still be traversable.
|
||||
[b]Note:[/b] While baking, this value will be rounded down to the nearest multiple of [member cell/height].
|
||||
</member>
|
||||
<member name="agent/max_slope" type="float" setter="set_agent_max_slope" getter="get_agent_max_slope" default="45.0">
|
||||
The maximum slope that is considered walkable, in degrees.
|
||||
</member>
|
||||
<member name="agent/radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="0.6">
|
||||
<member name="agent/radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="0.5">
|
||||
The distance to erode/shrink the walkable area of the heightfield away from obstructions.
|
||||
[b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell/size].
|
||||
</member>
|
||||
<member name="cell/height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.2">
|
||||
<member name="cell/height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.25">
|
||||
The Y axis cell size to use for fields.
|
||||
</member>
|
||||
<member name="cell/size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.3">
|
||||
<member name="cell/size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.25">
|
||||
The XZ plane cell size to use for fields.
|
||||
</member>
|
||||
<member name="detail/sample_distance" type="float" setter="set_detail_sample_distance" getter="get_detail_sample_distance" default="6.0">
|
||||
|
@ -138,7 +138,7 @@
|
|||
Any regions with a size smaller than this will be merged with larger regions if possible.
|
||||
[b]Note:[/b] This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400.
|
||||
</member>
|
||||
<member name="region/min_size" type="float" setter="set_region_min_size" getter="get_region_min_size" default="8.0">
|
||||
<member name="region/min_size" type="float" setter="set_region_min_size" getter="get_region_min_size" default="2.0">
|
||||
The minimum size of a region for it to be created.
|
||||
[b]Note:[/b] This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64.
|
||||
</member>
|
||||
|
|
|
@ -485,12 +485,12 @@ void NavigationMesh::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::INT, "geometry/source_geometry_mode", PROPERTY_HINT_ENUM, "Navmesh Children, Group With Children, Group Explicit"), "set_source_geometry_mode", "get_source_geometry_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "geometry/source_group_name"), "set_source_group_name", "get_source_group_name");
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell/size", PROPERTY_HINT_RANGE, "0.1,1.0,0.01,or_greater"), "set_cell_size", "get_cell_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell/height", PROPERTY_HINT_RANGE, "0.1,1.0,0.01,or_greater"), "set_cell_height", "get_cell_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/height", PROPERTY_HINT_RANGE, "0.1,5.0,0.01,or_greater"), "set_agent_height", "get_agent_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/radius", PROPERTY_HINT_RANGE, "0.1,5.0,0.01,or_greater"), "set_agent_radius", "get_agent_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/max_climb", PROPERTY_HINT_RANGE, "0.1,5.0,0.01,or_greater"), "set_agent_max_climb", "get_agent_max_climb");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/max_slope", PROPERTY_HINT_RANGE, "0.0,90.0,0.1"), "set_agent_max_slope", "get_agent_max_slope");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell/size", PROPERTY_HINT_RANGE, "0.01,500.0,0.01,or_greater"), "set_cell_size", "get_cell_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "cell/height", PROPERTY_HINT_RANGE, "0.01,500.0,0.01,or_greater"), "set_cell_height", "get_cell_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/height", PROPERTY_HINT_RANGE, "0.0,500.0,0.01,or_greater"), "set_agent_height", "get_agent_height");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/radius", PROPERTY_HINT_RANGE, "0.0,500.0,0.01,or_greater"), "set_agent_radius", "get_agent_radius");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/max_climb", PROPERTY_HINT_RANGE, "0.0,500.0,0.01,or_greater"), "set_agent_max_climb", "get_agent_max_climb");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "agent/max_slope", PROPERTY_HINT_RANGE, "0.02,90.0,0.01"), "set_agent_max_slope", "get_agent_max_slope");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "region/min_size", PROPERTY_HINT_RANGE, "0.0,150.0,0.01,or_greater"), "set_region_min_size", "get_region_min_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "region/merge_size", PROPERTY_HINT_RANGE, "0.0,150.0,0.01,or_greater"), "set_region_merge_size", "get_region_merge_size");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "edge/max_length", PROPERTY_HINT_RANGE, "0.0,50.0,0.01,or_greater"), "set_edge_max_length", "get_edge_max_length");
|
||||
|
@ -536,13 +536,13 @@ void NavigationMesh::_validate_property(PropertyInfo &property) const {
|
|||
}
|
||||
|
||||
NavigationMesh::NavigationMesh() {
|
||||
cell_size = 0.3f;
|
||||
cell_height = 0.2f;
|
||||
agent_height = 2.0f;
|
||||
agent_radius = 0.6f;
|
||||
agent_max_climb = 0.9f;
|
||||
cell_size = 0.25f;
|
||||
cell_height = 0.25f;
|
||||
agent_height = 1.5f;
|
||||
agent_radius = 0.5f;
|
||||
agent_max_climb = 0.25f;
|
||||
agent_max_slope = 45.0f;
|
||||
region_min_size = 8.0f;
|
||||
region_min_size = 2.0f;
|
||||
region_merge_size = 20.0f;
|
||||
edge_max_length = 12.0f;
|
||||
edge_max_error = 1.3f;
|
||||
|
|
Loading…
Reference in a new issue