Skip to content

Commit

Permalink
Remove Navigation2D/3D nodes, and move the navigation map to the worl…
Browse files Browse the repository at this point in the history
…d resource
  • Loading branch information
groud committed Mar 10, 2021
1 parent 469ac1e commit a9dc53d
Show file tree
Hide file tree
Showing 39 changed files with 234 additions and 1,013 deletions.
59 changes: 0 additions & 59 deletions doc/classes/Navigation2D.xml

This file was deleted.

84 changes: 0 additions & 84 deletions doc/classes/Navigation3D.xml

This file was deleted.

18 changes: 1 addition & 17 deletions doc/classes/NavigationAgent2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
2D Agent used in navigation for collision avoidance.
</brief_description>
<description>
2D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. This can be done by having the agent as a child of a [Navigation2D] node, or using [method set_navigation]. [NavigationAgent2D] is physics safe.
2D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent2D] is physics safe.
</description>
<tutorials>
</tutorials>
Expand Down Expand Up @@ -37,13 +37,6 @@
Returns which index the agent is currently on in the navigation path's [PackedVector2Array].
</description>
</method>
<method name="get_navigation" qualifiers="const">
<return type="Node">
</return>
<description>
Returns the [Navigation2D] node that the agent is using for its navigation system.
</description>
</method>
<method name="get_next_location">
<return type="Vector2">
</return>
Expand Down Expand Up @@ -79,15 +72,6 @@
Returns true if the target location is reached. The target location is set using [method set_target_location]. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location].
</description>
</method>
<method name="set_navigation">
<return type="void">
</return>
<argument index="0" name="navigation" type="Node">
</argument>
<description>
Sets the [Navigation2D] node used by the agent. Useful when you don't want to make the agent a child of a [Navigation2D] node.
</description>
</method>
<method name="set_target_location">
<return type="void">
</return>
Expand Down
18 changes: 1 addition & 17 deletions doc/classes/NavigationAgent3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
3D Agent used in navigation for collision avoidance.
</brief_description>
<description>
3D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. This can be done by having the agent as a child of a [Navigation3D] node, or using [method set_navigation]. [NavigationAgent3D] is physics safe.
3D Agent that is used in navigation to reach a location while avoiding static and dynamic obstacles. The dynamic obstacles are avoided using RVO collision avoidance. The agent needs navigation data to work correctly. [NavigationAgent3D] is physics safe.
</description>
<tutorials>
</tutorials>
Expand Down Expand Up @@ -37,13 +37,6 @@
Returns which index the agent is currently on in the navigation path's [PackedVector3Array].
</description>
</method>
<method name="get_navigation" qualifiers="const">
<return type="Node">
</return>
<description>
Returns the [Navigation3D] node that the agent is using for its navigation system.
</description>
</method>
<method name="get_next_location">
<return type="Vector3">
</return>
Expand Down Expand Up @@ -79,15 +72,6 @@
Returns true if the target location is reached. The target location is set using [method set_target_location]. It may not always be possible to reach the target location. It should always be possible to reach the final location though. See [method get_final_location].
</description>
</method>
<method name="set_navigation">
<return type="void">
</return>
<argument index="0" name="navigation" type="Node">
</argument>
<description>
Sets the [Navigation3D] node used by the agent. Useful when you don't want to make the agent a child of a [Navigation3D] node.
</description>
</method>
<method name="set_target_location">
<return type="void">
</return>
Expand Down
18 changes: 1 addition & 17 deletions doc/classes/NavigationObstacle2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,11 @@
2D Obstacle used in navigation for collision avoidance.
</brief_description>
<description>
2D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. This can be done by having the obstacle as a child of a [Navigation2D] node, or using [method set_navigation]. [NavigationObstacle2D] is physics safe.
2D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. [NavigationObstacle2D] is physics safe.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_navigation" qualifiers="const">
<return type="Node">
</return>
<description>
Returns the [Navigation2D] node that the obstacle is using for its navigation system.
</description>
</method>
<method name="set_navigation">
<return type="void">
</return>
<argument index="0" name="navigation" type="Node">
</argument>
<description>
Sets the [Navigation2D] node used by the obstacle. Useful when you don't want to make the obstacle a child of a [Navigation2D] node.
</description>
</method>
</methods>
<constants>
</constants>
Expand Down
18 changes: 1 addition & 17 deletions doc/classes/NavigationObstacle3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,11 @@
3D Obstacle used in navigation for collision avoidance.
</brief_description>
<description>
3D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. This can be done by having the obstacle as a child of a [Navigation3D] node, or using [method set_navigation]. [NavigationObstacle3D] is physics safe.
3D Obstacle used in navigation for collision avoidance. The obstacle needs navigation data to work correctly. [NavigationObstacle3D] is physics safe.
</description>
<tutorials>
</tutorials>
<methods>
<method name="get_navigation" qualifiers="const">
<return type="Node">
</return>
<description>
Returns the [Navigation3D] node that the obstacle is using for its navigation system.
</description>
</method>
<method name="set_navigation">
<return type="void">
</return>
<argument index="0" name="navigation" type="Node">
</argument>
<description>
Sets the [Navigation3D] node used by the obstacle. Useful when you don't want to make the obstacle a child of a [Navigation3D] node.
</description>
</method>
</methods>
<constants>
</constants>
Expand Down
2 changes: 1 addition & 1 deletion doc/classes/NavigationRegion3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
A region of the navigation map.
</brief_description>
<description>
A region of the navigation map. It tells the [Navigation3D] node what can be navigated and what cannot, based on the [NavigationMesh] resource. This should be a child of a [Navigation3D] node (even not a direct child).
A region of the navigation map. It tells the [NavigationServer3D] what can be navigated and what cannot, based on its [NavigationMesh] resource.
</description>
<tutorials>
</tutorials>
Expand Down
8 changes: 8 additions & 0 deletions doc/classes/ProjectSettings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,14 @@
</member>
<member name="mono/unhandled_exception_policy" type="int" setter="" getter="" default="0">
</member>
<member name="navigation/2d/default_cell_size" type="int" setter="" getter="" default="10">
</member>
<member name="navigation/2d/default_edge_connection_margin" type="int" setter="" getter="" default="100">
</member>
<member name="navigation/3d/default_cell_size" type="float" setter="" getter="" default="0.3">
</member>
<member name="navigation/3d/default_edge_connection_margin" type="float" setter="" getter="" default="5.0">
</member>
<member name="network/limits/debugger/max_chars_per_second" type="int" setter="" getter="" default="32768">
Maximum amount of characters allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection.
</member>
Expand Down
3 changes: 3 additions & 0 deletions doc/classes/TileMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@
</method>
</methods>
<members>
<member name="bake_navigation" type="bool" setter="set_bake_navigation" getter="is_baking_navigation" default="false">
If [code]true[/code], this TileMap bakes a navigation region.
</member>
<member name="cell_clip_uv" type="bool" setter="set_clip_uv" getter="get_clip_uv" default="false">
If [code]true[/code], the cell's UVs will be clipped.
</member>
Expand Down
3 changes: 3 additions & 0 deletions doc/classes/World2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<member name="direct_space_state" type="PhysicsDirectSpaceState2D" setter="" getter="get_direct_space_state">
Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to [code]_physics_process(delta)[/code] in the main thread.
</member>
<member name="navigation_map" type="RID" setter="" getter="get_navigation_map">
The [RID] of this world's navigation map. Used by the [NavigationServer2D].
</member>
<member name="space" type="RID" setter="" getter="get_space">
The [RID] of this world's physics space resource. Used by the [PhysicsServer2D] for 2D physics, treating it as both a space and an area.
</member>
Expand Down
3 changes: 3 additions & 0 deletions doc/classes/World3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
<member name="fallback_environment" type="Environment" setter="set_fallback_environment" getter="get_fallback_environment">
The World3D's fallback_environment will be used if the World3D's [Environment] fails or is missing.
</member>
<member name="navigation_map" type="RID" setter="" getter="get_navigation_map">
The [RID] of this world's navigation map. Used by the [NavigationServer3D].
</member>
<member name="scenario" type="RID" setter="" getter="get_scenario">
The World3D's visual scenario.
</member>
Expand Down
2 changes: 1 addition & 1 deletion editor/import/resource_importer_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "editor/import/scene_importer_mesh_node_3d.h"
#include "scene/3d/collision_shape_3d.h"
#include "scene/3d/mesh_instance_3d.h"
#include "scene/3d/navigation_3d.h"
#include "scene/3d/navigation_region_3d.h"
#include "scene/3d/physics_body_3d.h"
#include "scene/3d/vehicle_body_3d.h"
#include "scene/animation/animation_player.h"
Expand Down
4 changes: 2 additions & 2 deletions modules/gdnavigation/nav_region.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
#ifndef NAV_REGION_H
#define NAV_REGION_H

#include "nav_rid.h"
#include "scene/resources/navigation_mesh.h"

#include "nav_rid.h"
#include "nav_utils.h"
#include "scene/3d/navigation_3d.h"
#include <vector>

/**
Expand Down
3 changes: 3 additions & 0 deletions modules/gridmap/doc_classes/GridMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,9 @@
</method>
</methods>
<members>
<member name="bake_navigation" type="bool" setter="set_bake_navigation" getter="is_baking_navigation" default="false">
If [code]true[/code], this GridMap bakes a navigation region.
</member>
<member name="cell_center_x" type="bool" setter="set_center_x" getter="get_center_x" default="true">
If [code]true[/code], grid items are centered on the X axis.
</member>
Expand Down
Loading

0 comments on commit a9dc53d

Please sign in to comment.