mirror of
https://github.com/Relintai/pandemonium_engine_docs.git
synced 2025-01-23 15:17:21 +01:00
174 lines
8.8 KiB
ReStructuredText
174 lines
8.8 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. DO NOT EDIT THIS FILE!!!
|
|
.. Generated automatically from Godot engine sources.
|
|
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
|
|
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/NavigationMeshInstance.xml.
|
|
|
|
.. _class_NavigationMeshInstance:
|
|
|
|
NavigationMeshInstance
|
|
======================
|
|
|
|
**Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
An instance of a :ref:`NavigationMesh<class_NavigationMesh>`.
|
|
|
|
Description
|
|
-----------
|
|
|
|
An instance of a :ref:`NavigationMesh<class_NavigationMesh>`. It tells the :ref:`Navigation<class_Navigation>` node what can be navigated and what cannot, based on the :ref:`NavigationMesh<class_NavigationMesh>` resource.
|
|
|
|
By default this node will register to the default :ref:`World<class_World>` navigation map. If this node is a child of a :ref:`Navigation<class_Navigation>` node it will register to the navigation map of the navigation node.
|
|
|
|
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:`NavigationServer.map_set_edge_connection_margin<class_NavigationServer_method_map_set_edge_connection_margin>`.
|
|
|
|
\ **Note:** Overlapping two regions' navmeshes is not enough for connecting two regions. They must share a similar edge.
|
|
|
|
The cost of entering this region from another region can be controlled with the :ref:`enter_cost<class_NavigationMeshInstance_property_enter_cost>` value.
|
|
|
|
\ **Note:** This value is not added to the path cost when the start position is already inside this region.
|
|
|
|
The cost of traveling distances inside this region can be controlled with the :ref:`travel_cost<class_NavigationMeshInstance_property_travel_cost>` multiplier.
|
|
|
|
Properties
|
|
----------
|
|
|
|
+---------------------------------------------+-----------------------------------------------------------------------------------+----------+
|
|
| :ref:`bool<class_bool>` | :ref:`enabled<class_NavigationMeshInstance_property_enabled>` | ``true`` |
|
|
+---------------------------------------------+-----------------------------------------------------------------------------------+----------+
|
|
| :ref:`float<class_float>` | :ref:`enter_cost<class_NavigationMeshInstance_property_enter_cost>` | ``0.0`` |
|
|
+---------------------------------------------+-----------------------------------------------------------------------------------+----------+
|
|
| :ref:`int<class_int>` | :ref:`navigation_layers<class_NavigationMeshInstance_property_navigation_layers>` | ``1`` |
|
|
+---------------------------------------------+-----------------------------------------------------------------------------------+----------+
|
|
| :ref:`NavigationMesh<class_NavigationMesh>` | :ref:`navmesh<class_NavigationMeshInstance_property_navmesh>` | |
|
|
+---------------------------------------------+-----------------------------------------------------------------------------------+----------+
|
|
| :ref:`float<class_float>` | :ref:`travel_cost<class_NavigationMeshInstance_property_travel_cost>` | ``1.0`` |
|
|
+---------------------------------------------+-----------------------------------------------------------------------------------+----------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`bake_navigation_mesh<class_NavigationMeshInstance_method_bake_navigation_mesh>` **(** :ref:`bool<class_bool>` on_thread=true **)** |
|
|
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`RID<class_RID>` | :ref:`get_region_rid<class_NavigationMeshInstance_method_get_region_rid>` **(** **)** |const| |
|
|
+-----------------------+------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Signals
|
|
-------
|
|
|
|
.. _class_NavigationMeshInstance_signal_bake_finished:
|
|
|
|
- **bake_finished** **(** **)**
|
|
|
|
Notifies when the navigation mesh bake operation is completed.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMeshInstance_signal_navigation_mesh_changed:
|
|
|
|
- **navigation_mesh_changed** **(** **)**
|
|
|
|
Notifies when the :ref:`NavigationMesh<class_NavigationMesh>` has changed.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_NavigationMeshInstance_property_enabled:
|
|
|
|
- :ref:`bool<class_bool>` **enabled**
|
|
|
|
+-----------+--------------------+
|
|
| *Default* | ``true`` |
|
|
+-----------+--------------------+
|
|
| *Setter* | set_enabled(value) |
|
|
+-----------+--------------------+
|
|
| *Getter* | is_enabled() |
|
|
+-----------+--------------------+
|
|
|
|
Determines if the ``NavigationMeshInstance`` is enabled or disabled.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMeshInstance_property_enter_cost:
|
|
|
|
- :ref:`float<class_float>` **enter_cost**
|
|
|
|
+-----------+-----------------------+
|
|
| *Default* | ``0.0`` |
|
|
+-----------+-----------------------+
|
|
| *Setter* | set_enter_cost(value) |
|
|
+-----------+-----------------------+
|
|
| *Getter* | get_enter_cost() |
|
|
+-----------+-----------------------+
|
|
|
|
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.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMeshInstance_property_navigation_layers:
|
|
|
|
- :ref:`int<class_int>` **navigation_layers**
|
|
|
|
+-----------+------------------------------+
|
|
| *Default* | ``1`` |
|
|
+-----------+------------------------------+
|
|
| *Setter* | set_navigation_layers(value) |
|
|
+-----------+------------------------------+
|
|
| *Getter* | get_navigation_layers() |
|
|
+-----------+------------------------------+
|
|
|
|
A bitfield determining all navigation map layers the :ref:`NavigationMesh<class_NavigationMesh>` belongs to. On path requests with :ref:`NavigationServer.map_get_path<class_NavigationServer_method_map_get_path>` navmeshes without matching layers will be ignored and the navigation map will only proximity merge different navmeshes with matching layers.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMeshInstance_property_navmesh:
|
|
|
|
- :ref:`NavigationMesh<class_NavigationMesh>` **navmesh**
|
|
|
|
+----------+----------------------------+
|
|
| *Setter* | set_navigation_mesh(value) |
|
|
+----------+----------------------------+
|
|
| *Getter* | get_navigation_mesh() |
|
|
+----------+----------------------------+
|
|
|
|
The :ref:`NavigationMesh<class_NavigationMesh>` resource to use.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMeshInstance_property_travel_cost:
|
|
|
|
- :ref:`float<class_float>` **travel_cost**
|
|
|
|
+-----------+------------------------+
|
|
| *Default* | ``1.0`` |
|
|
+-----------+------------------------+
|
|
| *Setter* | set_travel_cost(value) |
|
|
+-----------+------------------------+
|
|
| *Getter* | get_travel_cost() |
|
|
+-----------+------------------------+
|
|
|
|
When pathfinding moves inside this region's navmesh the traveled distances are multiplied with ``travel_cost`` for determining the shortest path.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_NavigationMeshInstance_method_bake_navigation_mesh:
|
|
|
|
- void **bake_navigation_mesh** **(** :ref:`bool<class_bool>` on_thread=true **)**
|
|
|
|
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).
|
|
|
|
----
|
|
|
|
.. _class_NavigationMeshInstance_method_get_region_rid:
|
|
|
|
- :ref:`RID<class_RID>` **get_region_rid** **(** **)** |const|
|
|
|
|
Returns the :ref:`RID<class_RID>` of this region on the :ref:`NavigationServer<class_NavigationServer>`. Combined with :ref:`NavigationServer.map_get_closest_point_owner<class_NavigationServer_method_map_get_closest_point_owner>` can be used to identify the ``NavigationMeshInstance`` closest to a point on the merged navigation map.
|
|
|
|
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
|
|
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
|
|
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
|