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) 🔗
Adds a projected obstruction shape to the source geometry. If carve is true the carved shape will not be affected by additional offsets (e.g. agent radius) of the navigation mesh baking process.
void add_traversable_outline(shape_outline: PackedVector2Array) 🔗
將形狀的輪廓點新增為可走訪區域。
void append_obstruction_outlines(obstruction_outlines: Array[PackedVector2Array]) 🔗
Appends another array of obstruction_outlines at the end of the existing obstruction outlines array.
void append_traversable_outlines(traversable_outlines: Array[PackedVector2Array]) 🔗
Appends another array of traversable_outlines at the end of the existing traversable outlines array.
void clear() 🔗
清除內部資料。
void clear_projected_obstructions() 🔗
Clears all projected obstructions.
Returns an axis-aligned bounding box that covers all the stored geometry data. The bounds are calculated when calling this function with the result cached until further geometry changes are made.
Array[PackedVector2Array] get_obstruction_outlines() const 🔗
返回參數的絕對值。
Array get_projected_obstructions() const 🔗
Returns the projected obstructions as an Array of dictionaries. Each Dictionary contains the following entries:
vertices- A PackedFloat32Array that defines the outline points of the projected shape.carve- A bool that defines how the projected shape affects the navigation mesh baking. Iftruethe projected shape will not be affected by addition offsets, e.g. agent radius.
Array[PackedVector2Array] get_traversable_outlines() const 🔗
返回解析得到的源幾何體資料索引資料。
如果存在解析得到的源幾何體資料,則返回 true。
void merge(other_geometry: NavigationMeshSourceGeometryData2D) 🔗
Adds the geometry data of another NavigationMeshSourceGeometryData2D to the navigation mesh baking data.
void set_obstruction_outlines(obstruction_outlines: Array[PackedVector2Array]) 🔗
設定所有遮蔽區域輪廓陣列。
void set_projected_obstructions(projected_obstructions: Array) 🔗
Sets the projected obstructions with an Array of Dictionaries with the following key value pairs:
"vertices" : PackedFloat32Array
"carve" : bool
void set_traversable_outlines(traversable_outlines: Array[PackedVector2Array]) 🔗
設定所有可走訪區域輪廓陣列。