From ba1344408f66592eb1bec0b91b5bcdea8385ccdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gilles=20Roudi=C3=A8re?= Date: Mon, 8 Mar 2021 20:56:33 +0100 Subject: Implement Navigation layers --- doc/classes/@GlobalScope.xml | 32 ++++++---- doc/classes/NavigationRegion2D.xml | 9 +++ doc/classes/NavigationRegion3D.xml | 4 ++ doc/classes/NavigationServer2D.xml | 31 +++++++++- doc/classes/NavigationServer3D.xml | 35 +++++++++-- doc/classes/ProjectSettings.xml | 124 +++++++++++++++++++++++++++++++++++++ 6 files changed, 216 insertions(+), 19 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 380abed083..d57d241b53 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -2409,43 +2409,49 @@ Hints that an integer property is a bitmask using the optionally named 2D physics layers. - + + Hints that an integer property is a bitmask using the optionally named 2D navigation layers. + + Hints that an integer property is a bitmask using the optionally named 3D render layers. - + Hints that an integer property is a bitmask using the optionally named 3D physics layers. - + + Hints that an integer property is a bitmask using the optionally named 2D navigation layers. + + Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. - + Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. - + Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like [code]"*.png,*.jpg"[/code]. - + Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. - + Hints that a property is an instance of a [Resource]-derived type, optionally specified via the hint string (e.g. [code]"Texture2D"[/code]). Editing it will show a popup menu of valid resource types to instantiate. - + Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. - + Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. - + Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. - + Hints that an image is compressed using lossy compression. - + Hints that an image is compressed using lossless compression. - + Hint that a property represents a particular type. If a property is [constant TYPE_STRING], allows to set a type from the create dialog. If you need to create an [Array] to contain elements of a specific type, the [code]hint_string[/code] must encode nested types using [code]":"[/code] and [code]"/"[/code] for specifying [Resource] types. For instance: [codeblock] hint_string = "%s:" % [TYPE_INT] # Array of inteters. diff --git a/doc/classes/NavigationRegion2D.xml b/doc/classes/NavigationRegion2D.xml index aef114e1db..33a3f04c3d 100644 --- a/doc/classes/NavigationRegion2D.xml +++ b/doc/classes/NavigationRegion2D.xml @@ -1,8 +1,12 @@ + A region of the 2D navigation map. + A region of the navigation map. It tells the [NavigationServer2D] what can be navigated and what cannot, based on its [NavigationPolygon] resource. + Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using [method NavigationServer2D.map_set_edge_connection_margin]. + [b]Note:[/b] Overlapping two regions' polygons is not enough for connecting two regions. They must share a similar edge. @@ -10,8 +14,13 @@ + Determines if the [NavigationRegion2D] is enabled or disabled. + + + A bitfield determining all layers the region belongs to. These layers can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. + The [NavigationPolygon] resource to use. diff --git a/doc/classes/NavigationRegion3D.xml b/doc/classes/NavigationRegion3D.xml index e48c326ad7..2904ba4200 100644 --- a/doc/classes/NavigationRegion3D.xml +++ b/doc/classes/NavigationRegion3D.xml @@ -5,6 +5,7 @@ A region of the navigation map. It tells the [NavigationServer3D] what can be navigated and what cannot, based on its [NavigationMesh] resource. + Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using [method NavigationServer3D.map_set_edge_connection_margin]. @@ -21,6 +22,9 @@ Determines if the [NavigationRegion3D] is enabled or disabled. + + A bitfield determining all layers the region belongs to. These layers can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. + The [NavigationMesh] resource to use. diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml index 5f0b04487e..4f34a8a424 100644 --- a/doc/classes/NavigationServer2D.xml +++ b/doc/classes/NavigationServer2D.xml @@ -4,7 +4,12 @@ Server interface for low-level 2D navigation access - NavigationServer2D is the server responsible for all 2D navigation. It creates the agents, maps, and regions for navigation to work as expected. This keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. + NavigationServer2D is the server responsible for all 2D navigation. It handles several objects, namely maps, regions and agents. + Maps are made up of regions, which are made of navigation polygons. Together, they define the navigable areas in the 2D world. For two regions to be connected to each other, they must share a similar edge. An edges is considered connected to another if both of its two vertices are at a distance less than [code]edge_connection_margin[/code] to the respective other edge's vertex. + You may assign navigation layers to regions with [method NavigationServer2D.region_set_layers], which then can be checked upon when requesting a path with [method NavigationServer2D.map_get_path]. This allows allowing or forbidding some areas to 2D objects. + To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. + [b]Note:[/b] the collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. + This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. https://godotengine.org/asset-library/asset/117 @@ -207,8 +212,10 @@ + + - Returns the navigation path to reach the destination from the origin, while avoiding static obstacles. + Returns the navigation path to reach the destination from the origin. [code]layers[/code] is a bitmask of all region layers that are allowed to be in the path. @@ -260,6 +267,26 @@ Creates a new region. + + + + + + + Returns the region's layers. + + + + + + + + + + + Set the region's layers. This allows selecting regions from a path request (when using [method NavigationServer2D.map_get_path]). + + diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml index 95890c4b4c..0653c0d27d 100644 --- a/doc/classes/NavigationServer3D.xml +++ b/doc/classes/NavigationServer3D.xml @@ -4,7 +4,12 @@ Server interface for low-level 3D navigation access - NavigationServer3D is the server responsible for all 3D navigation. It creates the agents, maps, and regions for navigation to work as expected. This keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. + NavigationServer3D is the server responsible for all 3D navigation. It handles several objects, namely maps, regions and agents. + Maps are made up of regions, which are made of navigation meshes. Together, they define the navigable areas in the 3D world. For two regions to be connected to each other, they must share a similar edge. An edges is considered connected to another if both of its two vertices are at a distance less than [code]edge_connection_margin[/code] to the respective other edge's vertex. + You may assign navigation layers to regions with [method NavigationServer3D.region_set_layers], which then can be checked upon when requesting a path with [method NavigationServer3D.map_get_path]. This allows allowing or forbidding some areas to 3D objects. + To use the collision avoidance system, you may use agents. You can set an agent's target velocity, then the servers will emit a callback with a modified velocity. + [b]Note:[/b] the collision avoidance system ignores regions. Using the modified velocity as-is might lead to pushing and agent outside of a navigable area. This is a limitation of the collision avoidance system, any more complex situation may require the use of the physics engine. + This server keeps tracks of any call and executes them during the sync phase. This means that you can request any change to the map, using any thread, without worrying. https://godotengine.org/asset-library/asset/124 @@ -219,7 +224,7 @@ - Returns the edge connection margin of the map. + Returns the edge connection margin of the map. This distance is the minimum vertex distance needed to connect two edges from different regions. @@ -233,8 +238,10 @@ + + - Returns the navigation path to reach the destination from the origin. + Returns the navigation path to reach the destination from the origin. [code]layers[/code] is a bitmask of all region layers that are allowed to be in the path. @@ -285,7 +292,7 @@ - Set the map edge connection margein used to weld the compatible region edges. + Set the map edge connection margin used to weld the compatible region edges. @@ -328,6 +335,26 @@ Creates a new region. + + + + + + + Returns the region's layers. + + + + + + + + + + + Set the region's layers. This allows selecting regions from a path request (when using [method NavigationServer3D.map_get_path]). + + diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index f551022437..ac63c5da79 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -758,6 +758,66 @@ Specifies the [TextServer] to use. If left empty, the default will be used. + + Optional name for the 2D navigation layer 0. If left empty, the layer will display as "Layer 0". + + + Optional name for the 2D navigation layer 1. If left empty, the layer will display as "Layer 1". + + + Optional name for the 2D navigation layer 10. If left empty, the layer will display as "Layer 10". + + + Optional name for the 2D navigation layer 11. If left empty, the layer will display as "Layer 11". + + + Optional name for the 2D navigation layer 12. If left empty, the layer will display as "Layer 12". + + + Optional name for the 2D navigation layer 13. If left empty, the layer will display as "Layer 13". + + + Optional name for the 2D navigation layer 14. If left empty, the layer will display as "Layer 14". + + + Optional name for the 2D navigation layer 15. If left empty, the layer will display as "Layer 15". + + + Optional name for the 2D navigation layer 16. If left empty, the layer will display as "Layer 16". + + + Optional name for the 2D navigation layer 17. If left empty, the layer will display as "Layer 17". + + + Optional name for the 2D navigation layer 18. If left empty, the layer will display as "Layer 18". + + + Optional name for the 2D navigation layer 19. If left empty, the layer will display as "Layer 19". + + + Optional name for the 2D navigation layer 2. If left empty, the layer will display as "Layer 2". + + + Optional name for the 2D navigation layer 3. If left empty, the layer will display as "Layer 3". + + + Optional name for the 2D navigation layer 4. If left empty, the layer will display as "Layer 4". + + + Optional name for the 2D navigation layer 5. If left empty, the layer will display as "Layer 5". + + + Optional name for the 2D navigation layer 6. If left empty, the layer will display as "Layer 6". + + + Optional name for the 2D navigation layer 7. If left empty, the layer will display as "Layer 7". + + + Optional name for the 2D navigation layer 8. If left empty, the layer will display as "Layer 8". + + + Optional name for the 2D navigation layer 9. If left empty, the layer will display as "Layer 9". + Optional name for the 2D physics layer 0. If left empty, the layer will display as "Layer 0". @@ -878,6 +938,66 @@ Optional name for the 2D render layer 9. If left empty, the layer will display as "Layer 9". + + Optional name for the 3D navigation layer 0. If left empty, the layer will display as "Layer 0". + + + Optional name for the 3D navigation layer 1. If left empty, the layer will display as "Layer 1". + + + Optional name for the 3D navigation layer 10. If left empty, the layer will display as "Layer 10". + + + Optional name for the 3D navigation layer 11. If left empty, the layer will display as "Layer 11". + + + Optional name for the 3D navigation layer 12. If left empty, the layer will display as "Layer 12". + + + Optional name for the 3D navigation layer 13. If left empty, the layer will display as "Layer 13". + + + Optional name for the 3D navigation layer 14. If left empty, the layer will display as "Layer 14". + + + Optional name for the 3D navigation layer 15. If left empty, the layer will display as "Layer 15". + + + Optional name for the 3D navigation layer 16. If left empty, the layer will display as "Layer 16". + + + Optional name for the 3D navigation layer 17. If left empty, the layer will display as "Layer 17". + + + Optional name for the 3D navigation layer 18. If left empty, the layer will display as "Layer 18". + + + Optional name for the 3D navigation layer 19. If left empty, the layer will display as "Layer 19". + + + Optional name for the 3D navigation layer 2. If left empty, the layer will display as "Layer 2". + + + Optional name for the 3D navigation layer 3. If left empty, the layer will display as "Layer 3". + + + Optional name for the 3D navigation layer 4. If left empty, the layer will display as "Layer 4". + + + Optional name for the 3D navigation layer 5. If left empty, the layer will display as "Layer 5". + + + Optional name for the 3D navigation layer 6. If left empty, the layer will display as "Layer 6". + + + Optional name for the 3D navigation layer 7. If left empty, the layer will display as "Layer 7". + + + Optional name for the 3D navigation layer 8. If left empty, the layer will display as "Layer 8". + + + Optional name for the 3D navigation layer 9. If left empty, the layer will display as "Layer 9". + Optional name for the 3D physics layer 0. If left empty, the layer will display as "Layer 0". @@ -1021,12 +1141,16 @@ + Default cell size for 2D navigation maps. See [method NavigationServer2D.map_set_cell_size]. + Default edge connection margin for 2D navigation maps. See [method NavigationServer2D.map_set_edge_connection_margin]. + Default cell size for 3D navigation maps. See [method NavigationServer3D.map_set_cell_size]. + Default edge connection margin for 3D navigation maps. See [method NavigationServer3D.map_set_edge_connection_margin]. 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. -- cgit v1.2.3