Navigation.xml 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="Navigation" inherits="Spatial" category="Core" version="3.1">
  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. <demos>
  12. </demos>
  13. <methods>
  14. <method name="get_closest_point">
  15. <return type="Vector3">
  16. </return>
  17. <argument index="0" name="to_point" type="Vector3">
  18. </argument>
  19. <description>
  20. Returns the navigation point closest to the point given. Points are in local coordinate space.
  21. </description>
  22. </method>
  23. <method name="get_closest_point_normal">
  24. <return type="Vector3">
  25. </return>
  26. <argument index="0" name="to_point" type="Vector3">
  27. </argument>
  28. <description>
  29. 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.
  30. </description>
  31. </method>
  32. <method name="get_closest_point_owner">
  33. <return type="Object">
  34. </return>
  35. <argument index="0" name="to_point" type="Vector3">
  36. </argument>
  37. <description>
  38. 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).
  39. </description>
  40. </method>
  41. <method name="get_closest_point_to_segment">
  42. <return type="Vector3">
  43. </return>
  44. <argument index="0" name="start" type="Vector3">
  45. </argument>
  46. <argument index="1" name="end" type="Vector3">
  47. </argument>
  48. <argument index="2" name="use_collision" type="bool" default="false">
  49. </argument>
  50. <description>
  51. 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.
  52. </description>
  53. </method>
  54. <method name="get_simple_path">
  55. <return type="PoolVector3Array">
  56. </return>
  57. <argument index="0" name="start" type="Vector3">
  58. </argument>
  59. <argument index="1" name="end" type="Vector3">
  60. </argument>
  61. <argument index="2" name="optimize" type="bool" default="true">
  62. </argument>
  63. <description>
  64. 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] (raidus, height, etc.) are considered in the path calculation, otherwise they are ignored.
  65. </description>
  66. </method>
  67. <method name="navmesh_add">
  68. <return type="int">
  69. </return>
  70. <argument index="0" name="mesh" type="NavigationMesh">
  71. </argument>
  72. <argument index="1" name="xform" type="Transform">
  73. </argument>
  74. <argument index="2" name="owner" type="Object" default="null">
  75. </argument>
  76. <description>
  77. 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].
  78. </description>
  79. </method>
  80. <method name="navmesh_remove">
  81. <return type="void">
  82. </return>
  83. <argument index="0" name="id" type="int">
  84. </argument>
  85. <description>
  86. Removes the [NavigationMesh] with the given ID.
  87. </description>
  88. </method>
  89. <method name="navmesh_set_transform">
  90. <return type="void">
  91. </return>
  92. <argument index="0" name="id" type="int">
  93. </argument>
  94. <argument index="1" name="xform" type="Transform">
  95. </argument>
  96. <description>
  97. Sets the transform applied to the [NavigationMesh] with the given ID.
  98. </description>
  99. </method>
  100. </methods>
  101. <members>
  102. <member name="up_vector" type="Vector3" setter="set_up_vector" getter="get_up_vector">
  103. Defines which direction is up. By default this is [code](0, 1, 0)[/code], which is the world up direction.
  104. </member>
  105. </members>
  106. <constants>
  107. </constants>
  108. </class>