mirror of
https://github.com/Relintai/pandemonium_engine_docs.git
synced 2025-02-02 15:55:58 +01:00
590 lines
32 KiB
ReStructuredText
590 lines
32 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
|
|
.. DO NOT EDIT THIS FILE, but the NavigationMesh.xml source instead.
|
|
.. The source is found in doc/classes or modules/<name>/doc_classes.
|
|
|
|
.. _class_NavigationMesh:
|
|
|
|
NavigationMesh
|
|
==============
|
|
|
|
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
|
|
|
|
A mesh to approximate the walkable areas and obstacles.
|
|
|
|
Description
|
|
-----------
|
|
|
|
A navigation mesh is a collection of polygons that define which areas of an environment are traversable to aid agents in pathfinding through complicated spaces.
|
|
|
|
Tutorials
|
|
---------
|
|
|
|
- `3D Navmesh Demo <https://godotengine.org/asset-library/asset/124>`__
|
|
|
|
Properties
|
|
----------
|
|
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`agent/height<class_NavigationMesh_property_agent/height>` | ``2.0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`agent/max_climb<class_NavigationMesh_property_agent/max_climb>` | ``0.9`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`agent/max_slope<class_NavigationMesh_property_agent/max_slope>` | ``45.0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`agent/radius<class_NavigationMesh_property_agent/radius>` | ``0.6`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`cell/height<class_NavigationMesh_property_cell/height>` | ``0.2`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`cell/size<class_NavigationMesh_property_cell/size>` | ``0.3`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`detail/sample_distance<class_NavigationMesh_property_detail/sample_distance>` | ``6.0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`detail/sample_max_error<class_NavigationMesh_property_detail/sample_max_error>` | ``1.0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`edge/max_error<class_NavigationMesh_property_edge/max_error>` | ``1.3`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`edge/max_length<class_NavigationMesh_property_edge/max_length>` | ``12.0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`filter/filter_walkable_low_height_spans<class_NavigationMesh_property_filter/filter_walkable_low_height_spans>` | ``false`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`filter/ledge_spans<class_NavigationMesh_property_filter/ledge_spans>` | ``false`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`bool<class_bool>` | :ref:`filter/low_hanging_obstacles<class_NavigationMesh_property_filter/low_hanging_obstacles>` | ``false`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`int<class_int>` | :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>` | |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` | :ref:`geometry/parsed_geometry_type<class_NavigationMesh_property_geometry/parsed_geometry_type>` | ``0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` | :ref:`geometry/source_geometry_mode<class_NavigationMesh_property_geometry/source_geometry_mode>` | ``0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`String<class_String>` | :ref:`geometry/source_group_name<class_NavigationMesh_property_geometry/source_group_name>` | |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`polygon/verts_per_poly<class_NavigationMesh_property_polygon/verts_per_poly>` | ``6.0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`region/merge_size<class_NavigationMesh_property_region/merge_size>` | ``20.0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`float<class_float>` | :ref:`region/min_size<class_NavigationMesh_property_region/min_size>` | ``8.0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
| :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` | :ref:`sample_partition_type/sample_partition_type<class_NavigationMesh_property_sample_partition_type/sample_partition_type>` | ``0`` |
|
|
+---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+
|
|
|
|
Methods
|
|
-------
|
|
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`add_polygon<class_NavigationMesh_method_add_polygon>` **(** :ref:`PoolIntArray<class_PoolIntArray>` polygon **)** |
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`clear_polygons<class_NavigationMesh_method_clear_polygons>` **(** **)** |
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`create_from_mesh<class_NavigationMesh_method_create_from_mesh>` **(** :ref:`Mesh<class_Mesh>` mesh **)** |
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`get_collision_mask_bit<class_NavigationMesh_method_get_collision_mask_bit>` **(** :ref:`int<class_int>` bit **)** |const| |
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PoolIntArray<class_PoolIntArray>` | :ref:`get_polygon<class_NavigationMesh_method_get_polygon>` **(** :ref:`int<class_int>` idx **)** |
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`int<class_int>` | :ref:`get_polygon_count<class_NavigationMesh_method_get_polygon_count>` **(** **)** |const| |
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| :ref:`PoolVector3Array<class_PoolVector3Array>` | :ref:`get_vertices<class_NavigationMesh_method_get_vertices>` **(** **)** |const| |
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_collision_mask_bit<class_NavigationMesh_method_set_collision_mask_bit>` **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)** |
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
| void | :ref:`set_vertices<class_NavigationMesh_method_set_vertices>` **(** :ref:`PoolVector3Array<class_PoolVector3Array>` vertices **)** |
|
|
+-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
|
|
|
|
Enumerations
|
|
------------
|
|
|
|
.. _enum_NavigationMesh_SamplePartitionType:
|
|
|
|
.. _class_NavigationMesh_constant_SAMPLE_PARTITION_WATERSHED:
|
|
|
|
.. _class_NavigationMesh_constant_SAMPLE_PARTITION_MONOTONE:
|
|
|
|
.. _class_NavigationMesh_constant_SAMPLE_PARTITION_LAYERS:
|
|
|
|
.. _class_NavigationMesh_constant_SAMPLE_PARTITION_MAX:
|
|
|
|
enum **SamplePartitionType**:
|
|
|
|
- **SAMPLE_PARTITION_WATERSHED** = **0** --- Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas.
|
|
|
|
- **SAMPLE_PARTITION_MONOTONE** = **1** --- Monotone partitioning. Use this if you want fast navigation mesh generation.
|
|
|
|
- **SAMPLE_PARTITION_LAYERS** = **2** --- Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles.
|
|
|
|
- **SAMPLE_PARTITION_MAX** = **3** --- Represents the size of the :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` enum.
|
|
|
|
----
|
|
|
|
.. _enum_NavigationMesh_ParsedGeometryType:
|
|
|
|
.. _class_NavigationMesh_constant_PARSED_GEOMETRY_MESH_INSTANCES:
|
|
|
|
.. _class_NavigationMesh_constant_PARSED_GEOMETRY_STATIC_COLLIDERS:
|
|
|
|
.. _class_NavigationMesh_constant_PARSED_GEOMETRY_BOTH:
|
|
|
|
.. _class_NavigationMesh_constant_PARSED_GEOMETRY_MAX:
|
|
|
|
enum **ParsedGeometryType**:
|
|
|
|
- **PARSED_GEOMETRY_MESH_INSTANCES** = **0** --- Parses mesh instances as geometry. This includes :ref:`MeshInstance<class_MeshInstance>`, :ref:`CSGShape<class_CSGShape>`, and :ref:`GridMap<class_GridMap>` nodes.
|
|
|
|
- **PARSED_GEOMETRY_STATIC_COLLIDERS** = **1** --- Parses :ref:`StaticBody<class_StaticBody>` colliders as geometry. The collider should be in any of the layers specified by :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>`.
|
|
|
|
- **PARSED_GEOMETRY_BOTH** = **2** --- Both :ref:`PARSED_GEOMETRY_MESH_INSTANCES<class_NavigationMesh_constant_PARSED_GEOMETRY_MESH_INSTANCES>` and :ref:`PARSED_GEOMETRY_STATIC_COLLIDERS<class_NavigationMesh_constant_PARSED_GEOMETRY_STATIC_COLLIDERS>`.
|
|
|
|
- **PARSED_GEOMETRY_MAX** = **3** --- Represents the size of the :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` enum.
|
|
|
|
----
|
|
|
|
.. _enum_NavigationMesh_SourceGeometryMode:
|
|
|
|
.. _class_NavigationMesh_constant_SOURCE_GEOMETRY_NAVMESH_CHILDREN:
|
|
|
|
.. _class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN:
|
|
|
|
.. _class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_EXPLICIT:
|
|
|
|
.. _class_NavigationMesh_constant_SOURCE_GEOMETRY_MAX:
|
|
|
|
enum **SourceGeometryMode**:
|
|
|
|
- **SOURCE_GEOMETRY_NAVMESH_CHILDREN** = **0** --- Scans the child nodes of :ref:`NavigationMeshInstance<class_NavigationMeshInstance>` recursively for geometry.
|
|
|
|
- **SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN** = **1** --- Scans nodes in a group and their child nodes recursively for geometry. The group is specified by :ref:`geometry/source_group_name<class_NavigationMesh_property_geometry/source_group_name>`.
|
|
|
|
- **SOURCE_GEOMETRY_GROUPS_EXPLICIT** = **2** --- Uses nodes in a group for geometry. The group is specified by :ref:`geometry/source_group_name<class_NavigationMesh_property_geometry/source_group_name>`.
|
|
|
|
- **SOURCE_GEOMETRY_MAX** = **3** --- Represents the size of the :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` enum.
|
|
|
|
Property Descriptions
|
|
---------------------
|
|
|
|
.. _class_NavigationMesh_property_agent/height:
|
|
|
|
- :ref:`float<class_float>` **agent/height**
|
|
|
|
+-----------+-------------------------+
|
|
| *Default* | ``2.0`` |
|
|
+-----------+-------------------------+
|
|
| *Setter* | set_agent_height(value) |
|
|
+-----------+-------------------------+
|
|
| *Getter* | get_agent_height() |
|
|
+-----------+-------------------------+
|
|
|
|
The minimum floor to ceiling height that will still allow the floor area to be considered walkable.
|
|
|
|
**Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell/height<class_NavigationMesh_property_cell/height>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_agent/max_climb:
|
|
|
|
- :ref:`float<class_float>` **agent/max_climb**
|
|
|
|
+-----------+----------------------------+
|
|
| *Default* | ``0.9`` |
|
|
+-----------+----------------------------+
|
|
| *Setter* | set_agent_max_climb(value) |
|
|
+-----------+----------------------------+
|
|
| *Getter* | get_agent_max_climb() |
|
|
+-----------+----------------------------+
|
|
|
|
The minimum ledge height that is considered to still be traversable.
|
|
|
|
**Note:** While baking, this value will be rounded down to the nearest multiple of :ref:`cell/height<class_NavigationMesh_property_cell/height>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_agent/max_slope:
|
|
|
|
- :ref:`float<class_float>` **agent/max_slope**
|
|
|
|
+-----------+----------------------------+
|
|
| *Default* | ``45.0`` |
|
|
+-----------+----------------------------+
|
|
| *Setter* | set_agent_max_slope(value) |
|
|
+-----------+----------------------------+
|
|
| *Getter* | get_agent_max_slope() |
|
|
+-----------+----------------------------+
|
|
|
|
The maximum slope that is considered walkable, in degrees.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_agent/radius:
|
|
|
|
- :ref:`float<class_float>` **agent/radius**
|
|
|
|
+-----------+-------------------------+
|
|
| *Default* | ``0.6`` |
|
|
+-----------+-------------------------+
|
|
| *Setter* | set_agent_radius(value) |
|
|
+-----------+-------------------------+
|
|
| *Getter* | get_agent_radius() |
|
|
+-----------+-------------------------+
|
|
|
|
The distance to erode/shrink the walkable area of the heightfield away from obstructions.
|
|
|
|
**Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell/size<class_NavigationMesh_property_cell/size>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_cell/height:
|
|
|
|
- :ref:`float<class_float>` **cell/height**
|
|
|
|
+-----------+------------------------+
|
|
| *Default* | ``0.2`` |
|
|
+-----------+------------------------+
|
|
| *Setter* | set_cell_height(value) |
|
|
+-----------+------------------------+
|
|
| *Getter* | get_cell_height() |
|
|
+-----------+------------------------+
|
|
|
|
The Y axis cell size to use for fields.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_cell/size:
|
|
|
|
- :ref:`float<class_float>` **cell/size**
|
|
|
|
+-----------+----------------------+
|
|
| *Default* | ``0.3`` |
|
|
+-----------+----------------------+
|
|
| *Setter* | set_cell_size(value) |
|
|
+-----------+----------------------+
|
|
| *Getter* | get_cell_size() |
|
|
+-----------+----------------------+
|
|
|
|
The XZ plane cell size to use for fields.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_detail/sample_distance:
|
|
|
|
- :ref:`float<class_float>` **detail/sample_distance**
|
|
|
|
+-----------+-----------------------------------+
|
|
| *Default* | ``6.0`` |
|
|
+-----------+-----------------------------------+
|
|
| *Setter* | set_detail_sample_distance(value) |
|
|
+-----------+-----------------------------------+
|
|
| *Getter* | get_detail_sample_distance() |
|
|
+-----------+-----------------------------------+
|
|
|
|
The sampling distance to use when generating the detail mesh, in cell unit.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_detail/sample_max_error:
|
|
|
|
- :ref:`float<class_float>` **detail/sample_max_error**
|
|
|
|
+-----------+------------------------------------+
|
|
| *Default* | ``1.0`` |
|
|
+-----------+------------------------------------+
|
|
| *Setter* | set_detail_sample_max_error(value) |
|
|
+-----------+------------------------------------+
|
|
| *Getter* | get_detail_sample_max_error() |
|
|
+-----------+------------------------------------+
|
|
|
|
The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_edge/max_error:
|
|
|
|
- :ref:`float<class_float>` **edge/max_error**
|
|
|
|
+-----------+---------------------------+
|
|
| *Default* | ``1.3`` |
|
|
+-----------+---------------------------+
|
|
| *Setter* | set_edge_max_error(value) |
|
|
+-----------+---------------------------+
|
|
| *Getter* | get_edge_max_error() |
|
|
+-----------+---------------------------+
|
|
|
|
The maximum distance a simplfied contour's border edges should deviate the original raw contour.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_edge/max_length:
|
|
|
|
- :ref:`float<class_float>` **edge/max_length**
|
|
|
|
+-----------+----------------------------+
|
|
| *Default* | ``12.0`` |
|
|
+-----------+----------------------------+
|
|
| *Setter* | set_edge_max_length(value) |
|
|
+-----------+----------------------------+
|
|
| *Getter* | get_edge_max_length() |
|
|
+-----------+----------------------------+
|
|
|
|
The maximum allowed length for contour edges along the border of the mesh.
|
|
|
|
**Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell/size<class_NavigationMesh_property_cell/size>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_filter/filter_walkable_low_height_spans:
|
|
|
|
- :ref:`bool<class_bool>` **filter/filter_walkable_low_height_spans**
|
|
|
|
+-----------+---------------------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+---------------------------------------------+
|
|
| *Setter* | set_filter_walkable_low_height_spans(value) |
|
|
+-----------+---------------------------------------------+
|
|
| *Getter* | get_filter_walkable_low_height_spans() |
|
|
+-----------+---------------------------------------------+
|
|
|
|
If ``true``, marks walkable spans as not walkable if the clearance above the span is less than :ref:`agent/height<class_NavigationMesh_property_agent/height>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_filter/ledge_spans:
|
|
|
|
- :ref:`bool<class_bool>` **filter/ledge_spans**
|
|
|
|
+-----------+-------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-------------------------------+
|
|
| *Setter* | set_filter_ledge_spans(value) |
|
|
+-----------+-------------------------------+
|
|
| *Getter* | get_filter_ledge_spans() |
|
|
+-----------+-------------------------------+
|
|
|
|
If ``true``, marks spans that are ledges as non-walkable.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_filter/low_hanging_obstacles:
|
|
|
|
- :ref:`bool<class_bool>` **filter/low_hanging_obstacles**
|
|
|
|
+-----------+-----------------------------------------+
|
|
| *Default* | ``false`` |
|
|
+-----------+-----------------------------------------+
|
|
| *Setter* | set_filter_low_hanging_obstacles(value) |
|
|
+-----------+-----------------------------------------+
|
|
| *Getter* | get_filter_low_hanging_obstacles() |
|
|
+-----------+-----------------------------------------+
|
|
|
|
If ``true``, marks non-walkable spans as walkable if their maximum is within :ref:`agent/max_climb<class_NavigationMesh_property_agent/max_climb>` of a walkable neighbor.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_geometry/collision_mask:
|
|
|
|
- :ref:`int<class_int>` **geometry/collision_mask**
|
|
|
|
+----------+---------------------------+
|
|
| *Setter* | set_collision_mask(value) |
|
|
+----------+---------------------------+
|
|
| *Getter* | get_collision_mask() |
|
|
+----------+---------------------------+
|
|
|
|
The physics layers to scan for static colliders.
|
|
|
|
Only used when :ref:`geometry/parsed_geometry_type<class_NavigationMesh_property_geometry/parsed_geometry_type>` is :ref:`PARSED_GEOMETRY_STATIC_COLLIDERS<class_NavigationMesh_constant_PARSED_GEOMETRY_STATIC_COLLIDERS>` or :ref:`PARSED_GEOMETRY_BOTH<class_NavigationMesh_constant_PARSED_GEOMETRY_BOTH>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_geometry/parsed_geometry_type:
|
|
|
|
- :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` **geometry/parsed_geometry_type**
|
|
|
|
+-----------+---------------------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+---------------------------------+
|
|
| *Setter* | set_parsed_geometry_type(value) |
|
|
+-----------+---------------------------------+
|
|
| *Getter* | get_parsed_geometry_type() |
|
|
+-----------+---------------------------------+
|
|
|
|
Determines which type of nodes will be parsed as geometry. See :ref:`ParsedGeometryType<enum_NavigationMesh_ParsedGeometryType>` for possible values.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_geometry/source_geometry_mode:
|
|
|
|
- :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` **geometry/source_geometry_mode**
|
|
|
|
+-----------+---------------------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+---------------------------------+
|
|
| *Setter* | set_source_geometry_mode(value) |
|
|
+-----------+---------------------------------+
|
|
| *Getter* | get_source_geometry_mode() |
|
|
+-----------+---------------------------------+
|
|
|
|
The source of the geometry used when baking. See :ref:`SourceGeometryMode<enum_NavigationMesh_SourceGeometryMode>` for possible values.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_geometry/source_group_name:
|
|
|
|
- :ref:`String<class_String>` **geometry/source_group_name**
|
|
|
|
+----------+------------------------------+
|
|
| *Setter* | set_source_group_name(value) |
|
|
+----------+------------------------------+
|
|
| *Getter* | get_source_group_name() |
|
|
+----------+------------------------------+
|
|
|
|
The name of the group to scan for geometry.
|
|
|
|
Only used when :ref:`geometry/source_geometry_mode<class_NavigationMesh_property_geometry/source_geometry_mode>` is :ref:`SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN<class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN>` or :ref:`SOURCE_GEOMETRY_GROUPS_EXPLICIT<class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_EXPLICIT>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_polygon/verts_per_poly:
|
|
|
|
- :ref:`float<class_float>` **polygon/verts_per_poly**
|
|
|
|
+-----------+---------------------------+
|
|
| *Default* | ``6.0`` |
|
|
+-----------+---------------------------+
|
|
| *Setter* | set_verts_per_poly(value) |
|
|
+-----------+---------------------------+
|
|
| *Getter* | get_verts_per_poly() |
|
|
+-----------+---------------------------+
|
|
|
|
The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_region/merge_size:
|
|
|
|
- :ref:`float<class_float>` **region/merge_size**
|
|
|
|
+-----------+------------------------------+
|
|
| *Default* | ``20.0`` |
|
|
+-----------+------------------------------+
|
|
| *Setter* | set_region_merge_size(value) |
|
|
+-----------+------------------------------+
|
|
| *Getter* | get_region_merge_size() |
|
|
+-----------+------------------------------+
|
|
|
|
Any regions with a size smaller than this will be merged with larger regions if possible.
|
|
|
|
**Note:** This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_region/min_size:
|
|
|
|
- :ref:`float<class_float>` **region/min_size**
|
|
|
|
+-----------+----------------------------+
|
|
| *Default* | ``8.0`` |
|
|
+-----------+----------------------------+
|
|
| *Setter* | set_region_min_size(value) |
|
|
+-----------+----------------------------+
|
|
| *Getter* | get_region_min_size() |
|
|
+-----------+----------------------------+
|
|
|
|
The minimum size of a region for it to be created.
|
|
|
|
**Note:** This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_property_sample_partition_type/sample_partition_type:
|
|
|
|
- :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` **sample_partition_type/sample_partition_type**
|
|
|
|
+-----------+----------------------------------+
|
|
| *Default* | ``0`` |
|
|
+-----------+----------------------------------+
|
|
| *Setter* | set_sample_partition_type(value) |
|
|
+-----------+----------------------------------+
|
|
| *Getter* | get_sample_partition_type() |
|
|
+-----------+----------------------------------+
|
|
|
|
Partitioning algorithm for creating the navigation mesh polys. See :ref:`SamplePartitionType<enum_NavigationMesh_SamplePartitionType>` for possible values.
|
|
|
|
Method Descriptions
|
|
-------------------
|
|
|
|
.. _class_NavigationMesh_method_add_polygon:
|
|
|
|
- void **add_polygon** **(** :ref:`PoolIntArray<class_PoolIntArray>` polygon **)**
|
|
|
|
Adds a polygon using the indices of the vertices you get when calling :ref:`get_vertices<class_NavigationMesh_method_get_vertices>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_method_clear_polygons:
|
|
|
|
- void **clear_polygons** **(** **)**
|
|
|
|
Clears the array of polygons, but it doesn't clear the array of vertices.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_method_create_from_mesh:
|
|
|
|
- void **create_from_mesh** **(** :ref:`Mesh<class_Mesh>` mesh **)**
|
|
|
|
Initializes the navigation mesh by setting the vertices and indices according to a :ref:`Mesh<class_Mesh>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_method_get_collision_mask_bit:
|
|
|
|
- :ref:`bool<class_bool>` **get_collision_mask_bit** **(** :ref:`int<class_int>` bit **)** |const|
|
|
|
|
Returns whether the specified ``bit`` of the :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>` is set.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_method_get_polygon:
|
|
|
|
- :ref:`PoolIntArray<class_PoolIntArray>` **get_polygon** **(** :ref:`int<class_int>` idx **)**
|
|
|
|
Returns a :ref:`PoolIntArray<class_PoolIntArray>` containing the indices of the vertices of a created polygon.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_method_get_polygon_count:
|
|
|
|
- :ref:`int<class_int>` **get_polygon_count** **(** **)** |const|
|
|
|
|
Returns the number of polygons in the navigation mesh.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_method_get_vertices:
|
|
|
|
- :ref:`PoolVector3Array<class_PoolVector3Array>` **get_vertices** **(** **)** |const|
|
|
|
|
Returns a :ref:`PoolVector3Array<class_PoolVector3Array>` containing all the vertices being used to create the polygons.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_method_set_collision_mask_bit:
|
|
|
|
- void **set_collision_mask_bit** **(** :ref:`int<class_int>` bit, :ref:`bool<class_bool>` value **)**
|
|
|
|
If ``value`` is ``true``, sets the specified ``bit`` in the :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>`.
|
|
|
|
If ``value`` is ``false``, clears the specified ``bit`` in the :ref:`geometry/collision_mask<class_NavigationMesh_property_geometry/collision_mask>`.
|
|
|
|
----
|
|
|
|
.. _class_NavigationMesh_method_set_vertices:
|
|
|
|
- void **set_vertices** **(** :ref:`PoolVector3Array<class_PoolVector3Array>` vertices **)**
|
|
|
|
Sets the vertices that can be then indexed to create polygons with the :ref:`add_polygon<class_NavigationMesh_method_add_polygon>` method.
|
|
|
|
.. |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.)`
|