From 60298328caa445dee7c562fedbefec990b292f5a Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Wed, 11 Aug 2021 16:23:14 +0800 Subject: Improve NavigationMesh typing, parameter validation and documentation --- doc/classes/NavigationMesh.xml | 94 ++++++++++++++++++++++++++++++++---------- 1 file changed, 73 insertions(+), 21 deletions(-) (limited to 'doc/classes') diff --git a/doc/classes/NavigationMesh.xml b/doc/classes/NavigationMesh.xml index 1d9b2b0a36..89a394ef6c 100644 --- a/doc/classes/NavigationMesh.xml +++ b/doc/classes/NavigationMesh.xml @@ -1,8 +1,10 @@ + A mesh to approximate the walkable areas and obstacles. + A navigation mesh is a collection of polygons that define which areas of an environment are traversable to aid agents in pathfinding through complicated spaces. https://godotengine.org/asset-library/asset/124 @@ -12,39 +14,46 @@ + Adds a polygon using the indices of the vertices you get when calling [method get_vertices]. + Clears the array of polygons, but it doesn't clear the array of vertices. + Initializes the navigation mesh by setting the vertices and indices according to a [Mesh]. + Returns whether the specified [code]bit[/code] of the [member geometry/collision_mask] is set. + Returns a [PackedInt32Array] containing the indices of the vertices of a created polygon. + Returns the number of polygons in the navigation mesh. + Returns a [PackedVector3Array] containing all the vertices being used to create the polygons. @@ -52,84 +61,127 @@ + If [code]value[/code] is [code]true[/code], sets the specified [code]bit[/code] in the [member geometry/collision_mask]. + If [code]value[/code] is [code]false[/code], clears the specified [code]bit[/code] in the [member geometry/collision_mask]. + Sets the vertices that can be then indexed to create polygons with the [method add_polygon] method. - The minimum Y space needed for navigation to be generated. + 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]. - The maximum height difference between two areas for navigation to be generated between them. + 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]. - The maximum angle a slope can be at for navigation to be generated on it. + The maximum slope that is considered walkable, in degrees. - Determines where the edge of a navigation mesh is. This way an agent will not overlap with another mesh or stand over nothing. + 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]. - The height of a cell. + The Y axis cell size to use for fields. - The size of cells in the [NavigationMesh]. + The XZ plane cell size to use for fields. + The sampling distance to use when generating the detail mesh, in cell unit. + The maximum distance the detail mesh surface should deviate from heightfield, in cell unit. + The maximum distance a simplfied contour's border edges should deviate the original raw contour. + The maximum allowed length for contour edges along the border of the mesh. + [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell/size]. + If [code]true[/code], marks walkable spans as not walkable if the clearance above the span is less than [member agent/height]. + If [code]true[/code], marks spans that are ledges as non-walkable. + If [code]true[/code], marks non-walkable spans as walkable if their maximum is within [member agent/max_climb] of a walkable neighbor. - The physics layers used to generate the [NavigationMesh]. + The physics layers to scan for static colliders. + Only used when [member geometry/parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH]. - - What kind of geometry is used to generate the [NavigationMesh]. + + Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values. - - Which geometry is used to generate the [NavigationMesh]. + + The source of the geometry used when baking. See [enum SourceGeometryMode] for possible values. - The name of the group that is used to generate the [NavigationMesh]. + The name of the group to scan for geometry. + Only used when [member geometry/source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT]. - The number of vertices to use per polygon. Higher values will improve performance at the cost of lower precision. + The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. - If two adjacent regions' edges are separated by a distance lower than this value, the regions will be merged together. + 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. 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. - + + Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] for possible values. - + + Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas. - + + Monotone partitioning. Use this if you want fast navigation mesh generation. - + + Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles. - + + Represents the size of the [enum SamplePartitionType] enum. - + + Parses mesh instances as geometry. This includes [MeshInstance3D], [CSGShape3D], and [GridMap] nodes. - + + Parses [StaticBody3D] colliders as geometry. The collider should be in any of the layers specified by [member geometry/collision_mask]. + + + Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS]. + + + Represents the size of the [enum ParsedGeometryType] enum. + + + Scans the child nodes of [NavigationRegion3D] recursively for geometry. + + + Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member geometry/source_group_name]. + + + Uses nodes in a group for geometry. The group is specified by [member geometry/source_group_name]. + + + Represents the size of the [enum SourceGeometryMode] enum. -- cgit v1.2.3