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...
NavigationMeshSourceGeometryData2D
实验性: This class may be changed or removed in future versions.
继承: Resource < RefCounted < Object
存放解析所得的源几何体数据的容器,用于导航网格的烘焙。
描述
存放解析所得的源几何体数据的容器,用于导航网格的烘焙。
方法
void |
add_obstruction_outline(shape_outline: PackedVector2Array) |
void |
add_projected_obstruction(vertices: PackedVector2Array, carve: bool) |
void |
add_traversable_outline(shape_outline: PackedVector2Array) |
void |
append_obstruction_outlines(obstruction_outlines: Array[PackedVector2Array]) |
void |
append_traversable_outlines(traversable_outlines: Array[PackedVector2Array]) |
void |
clear() |
void |
|
get_obstruction_outlines() const |
|
get_projected_obstructions() const |
|
get_traversable_outlines() const |
|
has_data() |
|
void |
merge(other_geometry: NavigationMeshSourceGeometryData2D) |
void |
set_obstruction_outlines(obstruction_outlines: Array[PackedVector2Array]) |
void |
set_projected_obstructions(projected_obstructions: Array) |
void |
set_traversable_outlines(traversable_outlines: Array[PackedVector2Array]) |
方法说明
void add_obstruction_outline(shape_outline: PackedVector2Array) 🔗
添加形状的轮廓点作为遮挡区域。
void add_projected_obstruction(vertices: PackedVector2Array, carve: bool) 🔗
将投影的障碍物形状添加到源几何体。如果 carve
为 true
,则雕刻的形状将不会受到导航网格烘焙过程的额外偏移(例如代理半径)的影响。
void add_traversable_outline(shape_outline: PackedVector2Array) 🔗
添加形状的轮廓点作为可遍历区域。
void append_obstruction_outlines(obstruction_outlines: Array[PackedVector2Array]) 🔗
在已有障碍物轮廓数组的末尾追加另一个 obstruction_outlines
数组。
void append_traversable_outlines(traversable_outlines: Array[PackedVector2Array]) 🔗
在已有可遍历轮廓数组的末尾追加另一个 traversable_outlines
数组。
void clear() 🔗
清除内部数据。
void clear_projected_obstructions() 🔗
清除所有投射的障碍物。
返回覆盖所有存储几何数据的轴对齐边界框。边界在调用该函数时计算,缓存至几何体发生后续变化。
Array[PackedVector2Array] get_obstruction_outlines() const 🔗
返回所有遮挡区域轮廓数组。
Array get_projected_obstructions() const 🔗
将投影的障碍物作为字典的 Array 返回。每个 Dictionary 包含以下条目:
vertices
- 定义投影形状轮廓点的 PackedFloat32Array。carve
- 定义投影形状如何影响导航网格烘焙的 bool。如果为true
,则投影形状不会受到额外偏移的影响,例如代理半径。
Array[PackedVector2Array] get_traversable_outlines() const 🔗
返回所有可遍历区域轮廓数组。
当解析的源几何数据存在时,返回 true
。
void merge(other_geometry: NavigationMeshSourceGeometryData2D) 🔗
将其他 NavigationMeshSourceGeometryData2D 的几何体数据添加到导航网格烘焙数据。
void set_obstruction_outlines(obstruction_outlines: Array[PackedVector2Array]) 🔗
设置所有遮挡区域轮廓数组。
void set_projected_obstructions(projected_obstructions: Array) 🔗
使用包含以下键值对的字典数组设置投影障碍物:
"vertices" : PackedFloat32Array
"carve" : bool
void set_traversable_outlines(traversable_outlines: Array[PackedVector2Array]) 🔗
设置所有可遍历区域轮廓数组。