NavigationMeshSourceGeometryData3D
实验性: This class may be changed or removed in future versions.
继承: Resource
< RefCounted
< Object
Container for parsed source geometry data used in navigation mesh baking.
描述
Container for parsed source geometry data used in navigation mesh baking.
方法
void | add_faces ( faces: PackedVector3Array , xform: Transform3D ) |
void | add_mesh ( mesh: Mesh , xform: Transform3D ) |
void | add_mesh_array ( mesh_array: Array , xform: Transform3D ) |
void | add_projected_obstruction ( vertices: PackedVector3Array , elevation: float , height: float , carve: bool ) |
void | append_arrays ( vertices: PackedFloat32Array , indices: PackedInt32Array ) |
void | clear ( ) |
void | clear_projected_obstructions ( ) |
AABB | get_bounds ( ) |
PackedInt32Array | get_indices ( ) const1 |
Array | get_projected_obstructions ( ) const1 |
PackedFloat32Array | get_vertices ( ) const1 |
bool | has_data ( ) |
void | merge ( other_geometry: NavigationMeshSourceGeometryData3D ) |
void | set_indices ( indices: PackedInt32Array ) |
void | set_projected_obstructions ( projected_obstructions: Array ) |
void | set_vertices ( vertices: PackedFloat32Array ) |
方法说明
void
add_faces ( faces: PackedVector3Array
, xform: Transform3D
)
Adds an array of vertex positions to the geometry data for navigation mesh baking to form triangulated faces. For each face the array must have three vertex positions in clockwise winding order. Since NavigationMesh
resources have no transform, all vertex positions need to be offset by the node's transform using xform
.
void
add_mesh ( mesh: Mesh
, xform: Transform3D
)
Adds the geometry data of a Mesh
resource to the navigation mesh baking data. The mesh must have valid triangulated mesh data to be considered. Since NavigationMesh
resources have no transform, all vertex positions need to be offset by the node's transform using xform
.
void
add_mesh_array ( mesh_array: Array
, xform: Transform3D
)
Adds an Array
the size of Mesh.ARRAY_MAX
and with vertices at index Mesh.ARRAY_VERTEX
and indices at index Mesh.ARRAY_INDEX
to the navigation mesh baking data. The array must have valid triangulated mesh data to be considered. Since NavigationMesh
resources have no transform, all vertex positions need to be offset by the node's transform using xform
.
void
add_projected_obstruction ( vertices: PackedVector3Array
, elevation: float
, height: float
, carve: bool
)
Adds a projected obstruction shape to the source geometry. The vertices
are considered projected on a xz-axes plane, placed at the global y-axis elevation
and extruded by height
. 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
append_arrays ( vertices: PackedFloat32Array
, indices: PackedInt32Array
)
Appends arrays of vertices
and indices
at the end of the existing arrays. Adds the existing index as an offset to the appended indices.
void
clear ( )
Clears the internal data.
void
clear_projected_obstructions ( )
Clears all projected obstructions.
AABB
get_bounds ( )
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.
PackedInt32Array
get_indices ( ) const1
Returns the parsed source geometry data indices array.
Array
get_projected_obstructions ( ) const1
Returns the projected obstructions as an Array
of dictionaries. Each Dictionary
contains the following entries:
-
vertices
- APackedFloat32Array
that defines the outline points of the projected shape. -
elevation
- Afloat
that defines the projected shape placement on the y-axis. -
height
- Afloat
that defines how much the projected shape is extruded along the y-axis. -
carve
- Abool
that defines how the obstacle affects the navigation mesh baking. Iftrue
the projected shape will not be affected by addition offsets, e.g. agent radius.
PackedFloat32Array
get_vertices ( ) const1
Returns the parsed source geometry data vertices array.
bool
has_data ( )
Returns true
when parsed source geometry data exists.
void
merge ( other_geometry: NavigationMeshSourceGeometryData3D
)
Adds the geometry data of another NavigationMeshSourceGeometryData3D to the navigation mesh baking data.
void
set_indices ( indices: PackedInt32Array
)
Sets the parsed source geometry data indices. The indices need to be matched with appropriated vertices.
Warning: Inappropriate data can crash the baking process of the involved third-party libraries.
void
set_projected_obstructions ( projected_obstructions: Array
)
Sets the projected obstructions with an Array of Dictionaries with the following key value pairs:
"vertices" : PackedFloat32Array
"elevation" : float
"height" : float
"carve" : bool
void
set_vertices ( vertices: PackedFloat32Array
)
Sets the parsed source geometry data vertices. The vertices need to be matched with appropriated indices.
Warning: Inappropriate data can crash the baking process of the involved third-party libraries.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。