Navigation.xml 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Navigation" inherits="Spatial" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  3. <brief_description>
  4. Mesh-based navigation and pathfinding node.
  5. </brief_description>
  6. <description>
  7. [i]Deprecated.[/i] [Navigation] node and [method get_simple_path] are deprecated and will be removed in a future version. Use [method NavigationServer.map_get_path] instead.
  8. Provides navigation and pathfinding within a collection of [NavigationMesh]es. By default, these will be automatically collected from child [NavigationMeshInstance] nodes. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on.
  9. </description>
  10. <tutorials>
  11. <link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link>
  12. </tutorials>
  13. <methods>
  14. <method name="get_closest_point" qualifiers="const">
  15. <return type="Vector3" />
  16. <argument index="0" name="to_point" type="Vector3" />
  17. <description>
  18. Returns the navigation point closest to the point given. Points are in local coordinate space.
  19. </description>
  20. </method>
  21. <method name="get_closest_point_normal" qualifiers="const">
  22. <return type="Vector3" />
  23. <argument index="0" name="to_point" type="Vector3" />
  24. <description>
  25. Returns the surface normal at the navigation point closest to the point given. Useful for rotating a navigation agent according to the navigation mesh it moves on.
  26. </description>
  27. </method>
  28. <method name="get_closest_point_owner" qualifiers="const">
  29. <return type="RID" />
  30. <argument index="0" name="to_point" type="Vector3" />
  31. <description>
  32. Returns the owner of the [NavigationMesh] which contains the navigation point closest to the point given. This is usually a [NavigationMeshInstance].
  33. </description>
  34. </method>
  35. <method name="get_closest_point_to_segment" qualifiers="const">
  36. <return type="Vector3" />
  37. <argument index="0" name="start" type="Vector3" />
  38. <argument index="1" name="end" type="Vector3" />
  39. <argument index="2" name="use_collision" type="bool" default="false" />
  40. <description>
  41. Returns the navigation point closest to the given line segment. When enabling [code]use_collision[/code], only considers intersection points between segment and navigation meshes. If multiple intersection points are found, the one closest to the segment start point is returned.
  42. </description>
  43. </method>
  44. <method name="get_rid" qualifiers="const">
  45. <return type="RID" />
  46. <description>
  47. Returns the [RID] of the navigation map on the [NavigationServer].
  48. </description>
  49. </method>
  50. <method name="get_simple_path" qualifiers="const">
  51. <return type="PoolVector3Array" />
  52. <argument index="0" name="start" type="Vector3" />
  53. <argument index="1" name="end" type="Vector3" />
  54. <argument index="2" name="optimize" type="bool" default="true" />
  55. <description>
  56. [i]Deprecated.[/i] [Navigation] node and [method get_simple_path] are deprecated and will be removed in a future version. Use [method NavigationServer.map_get_path] instead.
  57. Returns the path between two given points. Points are in local coordinate space. If [code]optimize[/code] is [code]true[/code] (the default), the agent properties associated with each [NavigationMesh] (radius, height, etc.) are considered in the path calculation, otherwise they are ignored.
  58. </description>
  59. </method>
  60. </methods>
  61. <members>
  62. <member name="cell_height" type="float" setter="set_cell_height" getter="get_cell_height" default="0.25">
  63. The cell height to use for fields.
  64. </member>
  65. <member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.25">
  66. The XZ plane cell size to use for fields.
  67. </member>
  68. <member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="0.25">
  69. This value is used to detect the near edges to connect compatible regions.
  70. </member>
  71. <member name="navigation_layers" type="int" setter="set_navigation_layers" getter="get_navigation_layers" default="1">
  72. A bitfield determining all navigation map layers the navigation can use on a [method Navigation.get_simple_path] path query.
  73. </member>
  74. <member name="up_vector" type="Vector3" setter="set_up_vector" getter="get_up_vector" default="Vector3( 0, 1, 0 )">
  75. Defines which direction is up. By default, this is [code](0, 1, 0)[/code], which is the world's "up" direction.
  76. </member>
  77. </members>
  78. <signals>
  79. <signal name="map_changed">
  80. <argument index="0" name="map" type="RID" />
  81. <description>
  82. Emitted when a navigation map is updated, when a region moves or is modified.
  83. </description>
  84. </signal>
  85. </signals>
  86. <constants>
  87. </constants>
  88. </class>