NavigationMesh.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="NavigationMesh" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. A mesh to approximate the walkable areas and obstacles.
  5. </brief_description>
  6. <description>
  7. 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.
  8. </description>
  9. <tutorials>
  10. <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link>
  11. </tutorials>
  12. <methods>
  13. <method name="add_polygon">
  14. <return type="void" />
  15. <argument index="0" name="polygon" type="PoolIntArray" />
  16. <description>
  17. Adds a polygon using the indices of the vertices you get when calling [method get_vertices].
  18. </description>
  19. </method>
  20. <method name="clear_polygons">
  21. <return type="void" />
  22. <description>
  23. Clears the array of polygons, but it doesn't clear the array of vertices.
  24. </description>
  25. </method>
  26. <method name="create_from_mesh">
  27. <return type="void" />
  28. <argument index="0" name="mesh" type="Mesh" />
  29. <description>
  30. Initializes the navigation mesh by setting the vertices and indices according to a [Mesh].
  31. </description>
  32. </method>
  33. <method name="get_collision_mask_bit" qualifiers="const">
  34. <return type="bool" />
  35. <argument index="0" name="bit" type="int" />
  36. <description>
  37. Returns whether the specified [code]bit[/code] of the [member geometry_collision_mask] is set.
  38. </description>
  39. </method>
  40. <method name="get_polygon">
  41. <return type="PoolIntArray" />
  42. <argument index="0" name="idx" type="int" />
  43. <description>
  44. Returns a [PoolIntArray] containing the indices of the vertices of a created polygon.
  45. </description>
  46. </method>
  47. <method name="get_polygon_count" qualifiers="const">
  48. <return type="int" />
  49. <description>
  50. Returns the number of polygons in the navigation mesh.
  51. </description>
  52. </method>
  53. <method name="get_vertices" qualifiers="const">
  54. <return type="PoolVector3Array" />
  55. <description>
  56. Returns a [PoolVector3Array] containing all the vertices being used to create the polygons.
  57. </description>
  58. </method>
  59. <method name="set_collision_mask_bit">
  60. <return type="void" />
  61. <argument index="0" name="bit" type="int" />
  62. <argument index="1" name="value" type="bool" />
  63. <description>
  64. If [code]value[/code] is [code]true[/code], sets the specified [code]bit[/code] in the [member geometry_collision_mask].
  65. If [code]value[/code] is [code]false[/code], clears the specified [code]bit[/code] in the [member geometry_collision_mask].
  66. </description>
  67. </method>
  68. <method name="set_vertices">
  69. <return type="void" />
  70. <argument index="0" name="vertices" type="PoolVector3Array" />
  71. <description>
  72. Sets the vertices that can be then indexed to create polygons with the [method add_polygon] method.
  73. </description>
  74. </method>
  75. </methods>
  76. <members>
  77. <member name="agent_height" type="float" setter="set_agent_height" getter="get_agent_height" default="1.5">
  78. The minimum floor to ceiling height that will still allow the floor area to be considered walkable.
  79. [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_height].
  80. </member>
  81. <member name="agent_max_climb" type="float" setter="set_agent_max_climb" getter="get_agent_max_climb" default="0.25">
  82. The minimum ledge height that is considered to still be traversable.
  83. [b]Note:[/b] While baking, this value will be rounded down to the nearest multiple of [member cell_height].
  84. </member>
  85. <member name="agent_max_slope" type="float" setter="set_agent_max_slope" getter="get_agent_max_slope" default="45.0">
  86. The maximum slope that is considered walkable, in degrees.
  87. </member>
  88. <member name="agent_radius" type="float" setter="set_agent_radius" getter="get_agent_radius" default="0.5">
  89. The distance to erode/shrink the walkable area of the heightfield away from obstructions.
  90. [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size].
  91. </member>
  92. <member name="cell_height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.25">
  93. The Y axis cell size to use for fields.
  94. </member>
  95. <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.25">
  96. The XZ plane cell size to use for fields.
  97. </member>
  98. <member name="detail_sample_distance" type="float" setter="set_detail_sample_distance" getter="get_detail_sample_distance" default="6.0">
  99. The sampling distance to use when generating the detail mesh, in cell unit.
  100. </member>
  101. <member name="detail_sample_max_error" type="float" setter="set_detail_sample_max_error" getter="get_detail_sample_max_error" default="1.0">
  102. The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
  103. </member>
  104. <member name="edge_max_error" type="float" setter="set_edge_max_error" getter="get_edge_max_error" default="1.3">
  105. The maximum distance a simplfied contour's border edges should deviate the original raw contour.
  106. </member>
  107. <member name="edge_max_length" type="float" setter="set_edge_max_length" getter="get_edge_max_length" default="12.0">
  108. The maximum allowed length for contour edges along the border of the mesh.
  109. [b]Note:[/b] While baking, this value will be rounded up to the nearest multiple of [member cell_size].
  110. </member>
  111. <member name="filter_baking_aabb" type="AABB" setter="set_filter_baking_aabb" getter="get_filter_baking_aabb" default="AABB( 0, 0, 0, 0, 0, 0 )">
  112. If the baking [AABB] has a volume the navigation mesh baking will be restricted to its enclosing area.
  113. </member>
  114. <member name="filter_baking_aabb_offset" type="Vector3" setter="set_filter_baking_aabb_offset" getter="get_filter_baking_aabb_offset" default="Vector3( 0, 0, 0 )">
  115. The position offset applied to the [member filter_baking_aabb] [AABB].
  116. </member>
  117. <member name="filter_ledge_spans" type="bool" setter="set_filter_ledge_spans" getter="get_filter_ledge_spans" default="false">
  118. If [code]true[/code], marks spans that are ledges as non-walkable.
  119. </member>
  120. <member name="filter_low_hanging_obstacles" type="bool" setter="set_filter_low_hanging_obstacles" getter="get_filter_low_hanging_obstacles" default="false">
  121. If [code]true[/code], marks non-walkable spans as walkable if their maximum is within [member agent_max_climb] of a walkable neighbor.
  122. </member>
  123. <member name="filter_walkable_low_height_spans" type="bool" setter="set_filter_walkable_low_height_spans" getter="get_filter_walkable_low_height_spans" default="false">
  124. If [code]true[/code], marks walkable spans as not walkable if the clearance above the span is less than [member agent_height].
  125. </member>
  126. <member name="geometry_collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="4294967295">
  127. The physics layers to scan for static colliders.
  128. Only used when [member geometry_parsed_geometry_type] is [constant PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH].
  129. </member>
  130. <member name="geometry_parsed_geometry_type" type="int" setter="set_parsed_geometry_type" getter="get_parsed_geometry_type" enum="NavigationMesh.ParsedGeometryType" default="0">
  131. Determines which type of nodes will be parsed as geometry. See [enum ParsedGeometryType] for possible values.
  132. </member>
  133. <member name="geometry_source_geometry_mode" type="int" setter="set_source_geometry_mode" getter="get_source_geometry_mode" enum="NavigationMesh.SourceGeometryMode" default="0">
  134. The source of the geometry used when baking. See [enum SourceGeometryMode] for possible values.
  135. </member>
  136. <member name="geometry_source_group_name" type="String" setter="set_source_group_name" getter="get_source_group_name" default="&quot;navmesh&quot;">
  137. The name of the group to scan for geometry.
  138. Only used when [member geometry_source_geometry_mode] is [constant SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant SOURCE_GEOMETRY_GROUPS_EXPLICIT].
  139. </member>
  140. <member name="polygon_verts_per_poly" type="float" setter="set_verts_per_poly" getter="get_verts_per_poly" default="6.0">
  141. The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
  142. </member>
  143. <member name="region_merge_size" type="float" setter="set_region_merge_size" getter="get_region_merge_size" default="20.0">
  144. Any regions with a size smaller than this will be merged with larger regions if possible.
  145. [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.
  146. </member>
  147. <member name="region_min_size" type="float" setter="set_region_min_size" getter="get_region_min_size" default="2.0">
  148. The minimum size of a region for it to be created.
  149. [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.
  150. </member>
  151. <member name="sample_partition_type" type="int" setter="set_sample_partition_type" getter="get_sample_partition_type" enum="NavigationMesh.SamplePartitionType" default="0">
  152. Partitioning algorithm for creating the navigation mesh polys. See [enum SamplePartitionType] for possible values.
  153. </member>
  154. </members>
  155. <constants>
  156. <constant name="SAMPLE_PARTITION_WATERSHED" value="0" enum="SamplePartitionType">
  157. Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas.
  158. </constant>
  159. <constant name="SAMPLE_PARTITION_MONOTONE" value="1" enum="SamplePartitionType">
  160. Monotone partitioning. Use this if you want fast navigation mesh generation.
  161. </constant>
  162. <constant name="SAMPLE_PARTITION_LAYERS" value="2" enum="SamplePartitionType">
  163. Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles.
  164. </constant>
  165. <constant name="SAMPLE_PARTITION_MAX" value="3" enum="SamplePartitionType">
  166. Represents the size of the [enum SamplePartitionType] enum.
  167. </constant>
  168. <constant name="PARSED_GEOMETRY_MESH_INSTANCES" value="0" enum="ParsedGeometryType">
  169. Parses mesh instances as geometry. This includes [MeshInstance], [CSGShape], and [GridMap] nodes.
  170. </constant>
  171. <constant name="PARSED_GEOMETRY_STATIC_COLLIDERS" value="1" enum="ParsedGeometryType">
  172. Parses [StaticBody] colliders as geometry. The collider should be in any of the layers specified by [member geometry_collision_mask].
  173. </constant>
  174. <constant name="PARSED_GEOMETRY_BOTH" value="2" enum="ParsedGeometryType">
  175. Both [constant PARSED_GEOMETRY_MESH_INSTANCES] and [constant PARSED_GEOMETRY_STATIC_COLLIDERS].
  176. </constant>
  177. <constant name="PARSED_GEOMETRY_MAX" value="3" enum="ParsedGeometryType">
  178. Represents the size of the [enum ParsedGeometryType] enum.
  179. </constant>
  180. <constant name="SOURCE_GEOMETRY_NAVMESH_CHILDREN" value="0" enum="SourceGeometryMode">
  181. Scans the child nodes of [NavigationMeshInstance] recursively for geometry.
  182. </constant>
  183. <constant name="SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN" value="1" enum="SourceGeometryMode">
  184. Scans nodes in a group and their child nodes recursively for geometry. The group is specified by [member geometry_source_group_name].
  185. </constant>
  186. <constant name="SOURCE_GEOMETRY_GROUPS_EXPLICIT" value="2" enum="SourceGeometryMode">
  187. Uses nodes in a group for geometry. The group is specified by [member geometry_source_group_name].
  188. </constant>
  189. <constant name="SOURCE_GEOMETRY_MAX" value="3" enum="SourceGeometryMode">
  190. Represents the size of the [enum SourceGeometryMode] enum.
  191. </constant>
  192. </constants>
  193. </class>