Class NavigationMeshSourceGeometryData3D
Container for parsed source geometry data used in navigation mesh baking.
- Inheritance
-
NavigationMeshSourceGeometryData3D
Remarks
Container for parsed source geometry data used in navigation mesh baking.
Methods
add_faces(PackedVector3Array, 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_faces(PackedVector3Array faces, Transform3D xform)
Parameters
faces
PackedVector3Arrayxform
Transform3D
add_mesh(Mesh, 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(Mesh mesh, Transform3D xform)
Parameters
mesh
Meshxform
Transform3D
add_mesh_array(Array, 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_mesh_array(Array mesh_array, Transform3D xform)
Parameters
mesh_array
Arrayxform
Transform3D
add_projected_obstruction(PackedVector3Array, float, float, 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 add_projected_obstruction(PackedVector3Array vertices, float elevation, float height, bool carve)
Parameters
vertices
PackedVector3Arrayelevation
floatheight
floatcarve
bool
append_arrays(PackedFloat32Array, 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 append_arrays(PackedFloat32Array vertices, PackedInt32Array indices)
Parameters
vertices
PackedFloat32Arrayindices
PackedInt32Array
clear
Clears the internal data.
void clear
clear_projected_obstructions
Clears all projected obstructions.
void clear_projected_obstructions
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.
AABB get_bounds
get_indices
Qualifiers: const
Returns the parsed source geometry data indices array.
PackedInt32Array get_indices
get_projected_obstructions
Qualifiers: 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.elevation
- A float that defines the projected shape placement on the y-axis.height
- A float that defines how much the projected shape is extruded along the y-axis.carve
- A bool 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.
Array get_projected_obstructions
get_vertices
Qualifiers: const
Returns the parsed source geometry data vertices array.
PackedFloat32Array get_vertices
has_data
Returns true
when parsed source geometry data exists.
bool has_data
merge(NavigationMeshSourceGeometryData3D)
Adds the geometry data of another NavigationMeshSourceGeometryData3D to the navigation mesh baking data.
void merge(NavigationMeshSourceGeometryData3D other_geometry)
Parameters
other_geometry
NavigationMeshSourceGeometryData3D
set_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_indices(PackedInt32Array indices)
Parameters
indices
PackedInt32Array
set_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_projected_obstructions(Array projected_obstructions)
Parameters
projected_obstructions
Array
set_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.
void set_vertices(PackedFloat32Array vertices)
Parameters
vertices
PackedFloat32Array