class_navigationregion3d.rst 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/NavigationRegion3D.xml.
  6. .. _class_NavigationRegion3D:
  7. NavigationRegion3D
  8. ==================
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A region of the navigation map.
  11. Description
  12. -----------
  13. A region of the navigation map. It tells the :ref:`NavigationServer3D<class_NavigationServer3D>` what can be navigated and what cannot, based on its :ref:`NavigationMesh<class_NavigationMesh>` resource.
  14. Two regions can be connected to each other if they share a similar edge. You can set the minimum distance between two vertices required to connect two edges by using :ref:`NavigationServer3D.map_set_edge_connection_margin<class_NavigationServer3D_method_map_set_edge_connection_margin>`.
  15. \ **Note:** Overlapping two regions' navmeshes is not enough for connecting two regions. They must share a similar edge.
  16. The cost of entering this region from another region can be controlled with the :ref:`enter_cost<class_NavigationRegion3D_property_enter_cost>` value.
  17. \ **Note**: This value is not added to the path cost when the start position is already inside this region.
  18. The cost of traveling distances inside this region can be controlled with the :ref:`travel_cost<class_NavigationRegion3D_property_travel_cost>` multiplier.
  19. Properties
  20. ----------
  21. +---------------------------------------------+-------------------------------------------------------------------------------+----------+
  22. | :ref:`bool<class_bool>` | :ref:`enabled<class_NavigationRegion3D_property_enabled>` | ``true`` |
  23. +---------------------------------------------+-------------------------------------------------------------------------------+----------+
  24. | :ref:`float<class_float>` | :ref:`enter_cost<class_NavigationRegion3D_property_enter_cost>` | ``0.0`` |
  25. +---------------------------------------------+-------------------------------------------------------------------------------+----------+
  26. | :ref:`int<class_int>` | :ref:`navigation_layers<class_NavigationRegion3D_property_navigation_layers>` | ``1`` |
  27. +---------------------------------------------+-------------------------------------------------------------------------------+----------+
  28. | :ref:`NavigationMesh<class_NavigationMesh>` | :ref:`navmesh<class_NavigationRegion3D_property_navmesh>` | |
  29. +---------------------------------------------+-------------------------------------------------------------------------------+----------+
  30. | :ref:`float<class_float>` | :ref:`travel_cost<class_NavigationRegion3D_property_travel_cost>` | ``1.0`` |
  31. +---------------------------------------------+-------------------------------------------------------------------------------+----------+
  32. Methods
  33. -------
  34. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  35. | void | :ref:`bake_navigation_mesh<class_NavigationRegion3D_method_bake_navigation_mesh>` **(** :ref:`bool<class_bool>` on_thread=true **)** |
  36. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`bool<class_bool>` | :ref:`get_navigation_layer_value<class_NavigationRegion3D_method_get_navigation_layer_value>` **(** :ref:`int<class_int>` layer_number **)** |const| |
  38. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`RID<class_RID>` | :ref:`get_region_rid<class_NavigationRegion3D_method_get_region_rid>` **(** **)** |const| |
  40. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  41. | void | :ref:`set_navigation_layer_value<class_NavigationRegion3D_method_set_navigation_layer_value>` **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)** |
  42. +-------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  43. Signals
  44. -------
  45. .. _class_NavigationRegion3D_signal_bake_finished:
  46. - **bake_finished** **(** **)**
  47. Notifies when the navigation mesh bake operation is completed.
  48. ----
  49. .. _class_NavigationRegion3D_signal_navigation_mesh_changed:
  50. - **navigation_mesh_changed** **(** **)**
  51. Notifies when the :ref:`NavigationMesh<class_NavigationMesh>` has changed.
  52. Property Descriptions
  53. ---------------------
  54. .. _class_NavigationRegion3D_property_enabled:
  55. - :ref:`bool<class_bool>` **enabled**
  56. +-----------+--------------------+
  57. | *Default* | ``true`` |
  58. +-----------+--------------------+
  59. | *Setter* | set_enabled(value) |
  60. +-----------+--------------------+
  61. | *Getter* | is_enabled() |
  62. +-----------+--------------------+
  63. Determines if the ``NavigationRegion3D`` is enabled or disabled.
  64. ----
  65. .. _class_NavigationRegion3D_property_enter_cost:
  66. - :ref:`float<class_float>` **enter_cost**
  67. +-----------+-----------------------+
  68. | *Default* | ``0.0`` |
  69. +-----------+-----------------------+
  70. | *Setter* | set_enter_cost(value) |
  71. +-----------+-----------------------+
  72. | *Getter* | get_enter_cost() |
  73. +-----------+-----------------------+
  74. When pathfinding enters this region's navmesh from another regions navmesh the ``enter_cost`` value is added to the path distance for determining the shortest path.
  75. ----
  76. .. _class_NavigationRegion3D_property_navigation_layers:
  77. - :ref:`int<class_int>` **navigation_layers**
  78. +-----------+------------------------------+
  79. | *Default* | ``1`` |
  80. +-----------+------------------------------+
  81. | *Setter* | set_navigation_layers(value) |
  82. +-----------+------------------------------+
  83. | *Getter* | get_navigation_layers() |
  84. +-----------+------------------------------+
  85. A bitfield determining all navigation layers the region belongs to. These navigation layers can be checked upon when requesting a path with :ref:`NavigationServer3D.map_get_path<class_NavigationServer3D_method_map_get_path>`.
  86. ----
  87. .. _class_NavigationRegion3D_property_navmesh:
  88. - :ref:`NavigationMesh<class_NavigationMesh>` **navmesh**
  89. +----------+----------------------------+
  90. | *Setter* | set_navigation_mesh(value) |
  91. +----------+----------------------------+
  92. | *Getter* | get_navigation_mesh() |
  93. +----------+----------------------------+
  94. The :ref:`NavigationMesh<class_NavigationMesh>` resource to use.
  95. ----
  96. .. _class_NavigationRegion3D_property_travel_cost:
  97. - :ref:`float<class_float>` **travel_cost**
  98. +-----------+------------------------+
  99. | *Default* | ``1.0`` |
  100. +-----------+------------------------+
  101. | *Setter* | set_travel_cost(value) |
  102. +-----------+------------------------+
  103. | *Getter* | get_travel_cost() |
  104. +-----------+------------------------+
  105. When pathfinding moves inside this region's navmesh the traveled distances are multiplied with ``travel_cost`` for determining the shortest path.
  106. Method Descriptions
  107. -------------------
  108. .. _class_NavigationRegion3D_method_bake_navigation_mesh:
  109. - void **bake_navigation_mesh** **(** :ref:`bool<class_bool>` on_thread=true **)**
  110. Bakes the :ref:`NavigationMesh<class_NavigationMesh>`. If ``on_thread`` is set to ``true`` (default), the baking is done on a separate thread. Baking on separate thread is useful because navigation baking is not a cheap operation. When it is completed, it automatically sets the new :ref:`NavigationMesh<class_NavigationMesh>`. Please note that baking on separate thread may be very slow if geometry is parsed from meshes as async access to each mesh involves heavy synchronization. Also, please note that baking on a separate thread is automatically disabled on operating systems that cannot use threads (such as HTML5 with threads disabled).
  111. ----
  112. .. _class_NavigationRegion3D_method_get_navigation_layer_value:
  113. - :ref:`bool<class_bool>` **get_navigation_layer_value** **(** :ref:`int<class_int>` layer_number **)** |const|
  114. Returns whether or not the specified layer of the :ref:`navigation_layers<class_NavigationRegion3D_property_navigation_layers>` bitmask is enabled, given a ``layer_number`` between 1 and 32.
  115. ----
  116. .. _class_NavigationRegion3D_method_get_region_rid:
  117. - :ref:`RID<class_RID>` **get_region_rid** **(** **)** |const|
  118. Returns the :ref:`RID<class_RID>` of this region on the :ref:`NavigationServer3D<class_NavigationServer3D>`. Combined with :ref:`NavigationServer3D.map_get_closest_point_owner<class_NavigationServer3D_method_map_get_closest_point_owner>` can be used to identify the ``NavigationRegion3D`` closest to a point on the merged navigation map.
  119. ----
  120. .. _class_NavigationRegion3D_method_set_navigation_layer_value:
  121. - void **set_navigation_layer_value** **(** :ref:`int<class_int>` layer_number, :ref:`bool<class_bool>` value **)**
  122. Based on ``value``, enables or disables the specified layer in the :ref:`navigation_layers<class_NavigationRegion3D_property_navigation_layers>` bitmask, given a ``layer_number`` between 1 and 32.
  123. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  124. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  125. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  126. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  127. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  128. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`