Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
NavigationMesh¶
Inherits: Resource < RefCounted < Object
用于定义可达区域和障碍物的导航网格。
Description¶
导航网格是多边形的集合,用于定义环境中的哪些区域是可以穿越的,帮助代理在复杂的空间中寻路。
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Methods¶
void |
add_polygon ( PackedInt32Array polygon ) |
void |
clear ( ) |
void |
clear_polygons ( ) |
void |
create_from_mesh ( Mesh mesh ) |
get_collision_mask_value ( int layer_number ) const |
|
get_polygon ( int idx ) |
|
get_polygon_count ( ) const |
|
get_vertices ( ) const |
|
void |
set_collision_mask_value ( int layer_number, bool value ) |
void |
set_vertices ( PackedVector3Array vertices ) |
Enumerations¶
enum SamplePartitionType:
SamplePartitionType SAMPLE_PARTITION_WATERSHED = 0
分水岭分区。如果你预先计算导航网格,通常是最佳选择,如果你有大的开放区域,请使用它。
SamplePartitionType SAMPLE_PARTITION_MONOTONE = 1
单调分区。如果你想要快速生成导航网格,请使用此选项。
SamplePartitionType SAMPLE_PARTITION_LAYERS = 2
层分区。用于具有中小型图块的平铺导航网格的不错选择。
SamplePartitionType SAMPLE_PARTITION_MAX = 3
代表 SamplePartitionType 枚举的大小。
enum ParsedGeometryType:
ParsedGeometryType PARSED_GEOMETRY_MESH_INSTANCES = 0
将网格实例解析为几何体。包括 MeshInstance3D、CSGShape3D、GridMap 等节点。
ParsedGeometryType PARSED_GEOMETRY_STATIC_COLLIDERS = 1
将 StaticBody3D 碰撞器解析为几何体。碰撞器应在由 geometry_collision_mask 指定的层中。
ParsedGeometryType PARSED_GEOMETRY_BOTH = 2
PARSED_GEOMETRY_MESH_INSTANCES 和 PARSED_GEOMETRY_STATIC_COLL