Navigation.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Navigation" inherits="Spatial" category="Core" version="3.1.2">
  3. <brief_description>
  4. Mesh-based navigation and pathfinding node.
  5. </brief_description>
  6. <description>
  7. Provides navigation and pathfinding within a collection of [NavigationMesh]es. By default these will be automatically collected from child [NavigationMeshInstance] nodes, but they can also be added on the fly with [method navmesh_add]. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on.
  8. </description>
  9. <tutorials>
  10. </tutorials>
  11. <methods>
  12. <method name="get_closest_point">
  13. <return type="Vector3">
  14. </return>
  15. <argument index="0" name="to_point" type="Vector3">
  16. </argument>
  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">
  22. <return type="Vector3">
  23. </return>
  24. <argument index="0" name="to_point" type="Vector3">
  25. </argument>
  26. <description>
  27. 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.
  28. </description>
  29. </method>
  30. <method name="get_closest_point_owner">
  31. <return type="Object">
  32. </return>
  33. <argument index="0" name="to_point" type="Vector3">
  34. </argument>
  35. <description>
  36. Returns the owner of the [NavigationMesh] which contains the navigation point closest to the point given. This is usually a [NavigationMeshInstance]. For meshes added via [method navmesh_add], returns the owner that was given (or [code]null[/code] if the [code]owner[/code] parameter was omitted).
  37. </description>
  38. </method>
  39. <method name="get_closest_point_to_segment">
  40. <return type="Vector3">
  41. </return>
  42. <argument index="0" name="start" type="Vector3">
  43. </argument>
  44. <argument index="1" name="end" type="Vector3">
  45. </argument>
  46. <argument index="2" name="use_collision" type="bool" default="false">
  47. </argument>
  48. <description>
  49. 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.
  50. </description>
  51. </method>
  52. <method name="get_simple_path">
  53. <return type="PoolVector3Array">
  54. </return>
  55. <argument index="0" name="start" type="Vector3">
  56. </argument>
  57. <argument index="1" name="end" type="Vector3">
  58. </argument>
  59. <argument index="2" name="optimize" type="bool" default="true">
  60. </argument>
  61. <description>
  62. 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.
  63. </description>
  64. </method>
  65. <method name="navmesh_add">
  66. <return type="int">
  67. </return>
  68. <argument index="0" name="mesh" type="NavigationMesh">
  69. </argument>
  70. <argument index="1" name="xform" type="Transform">
  71. </argument>
  72. <argument index="2" name="owner" type="Object" default="null">
  73. </argument>
  74. <description>
  75. Adds a [NavigationMesh]. Returns an ID for use with [method navmesh_remove] or [method navmesh_set_transform]. If given, a [Transform2D] is applied to the polygon. The optional [code]owner[/code] is used as return value for [method get_closest_point_owner].
  76. </description>
  77. </method>
  78. <method name="navmesh_remove">
  79. <return type="void">
  80. </return>
  81. <argument index="0" name="id" type="int">
  82. </argument>
  83. <description>
  84. Removes the [NavigationMesh] with the given ID.
  85. </description>
  86. </method>
  87. <method name="navmesh_set_transform">
  88. <return type="void">
  89. </return>
  90. <argument index="0" name="id" type="int">
  91. </argument>
  92. <argument index="1" name="xform" type="Transform">
  93. </argument>
  94. <description>
  95. Sets the transform applied to the [NavigationMesh] with the given ID.
  96. </description>
  97. </method>
  98. </methods>
  99. <members>
  100. <member name="up_vector" type="Vector3" setter="set_up_vector" getter="get_up_vector">
  101. Defines which direction is up. By default this is [code](0, 1, 0)[/code], which is the world up direction.
  102. </member>
  103. </members>
  104. <constants>
  105. </constants>
  106. </class>