mirror of
https://github.com/godotengine/godot.git
synced 2024-12-21 10:25:24 +08:00
2e1f6b50fb
Adds get_bounds() function to NavigationMeshSourceGeometryData2D/3D to get a bounding box that covers all the geometry.
140 lines
6.5 KiB
XML
140 lines
6.5 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<class name="NavigationMeshSourceGeometryData3D" inherits="Resource" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
|
|
<brief_description>
|
|
Container for parsed source geometry data used in navigation mesh baking.
|
|
</brief_description>
|
|
<description>
|
|
Container for parsed source geometry data used in navigation mesh baking.
|
|
</description>
|
|
<tutorials>
|
|
</tutorials>
|
|
<methods>
|
|
<method name="add_faces">
|
|
<return type="void" />
|
|
<param index="0" name="faces" type="PackedVector3Array" />
|
|
<param index="1" name="xform" type="Transform3D" />
|
|
<description>
|
|
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 [param xform].
|
|
</description>
|
|
</method>
|
|
<method name="add_mesh">
|
|
<return type="void" />
|
|
<param index="0" name="mesh" type="Mesh" />
|
|
<param index="1" name="xform" type="Transform3D" />
|
|
<description>
|
|
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 [param xform].
|
|
</description>
|
|
</method>
|
|
<method name="add_mesh_array">
|
|
<return type="void" />
|
|
<param index="0" name="mesh_array" type="Array" />
|
|
<param index="1" name="xform" type="Transform3D" />
|
|
<description>
|
|
Adds an [Array] the size of [constant Mesh.ARRAY_MAX] and with vertices at index [constant Mesh.ARRAY_VERTEX] and indices at index [constant 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 [param xform].
|
|
</description>
|
|
</method>
|
|
<method name="add_projected_obstruction">
|
|
<return type="void" />
|
|
<param index="0" name="vertices" type="PackedVector3Array" />
|
|
<param index="1" name="elevation" type="float" />
|
|
<param index="2" name="height" type="float" />
|
|
<param index="3" name="carve" type="bool" />
|
|
<description>
|
|
Adds a projected obstruction shape to the source geometry. The [param vertices] are considered projected on a xz-axes plane, placed at the global y-axis [param elevation] and extruded by [param height]. If [param carve] is [code]true[/code] the carved shape will not be affected by additional offsets (e.g. agent radius) of the navigation mesh baking process.
|
|
</description>
|
|
</method>
|
|
<method name="append_arrays">
|
|
<return type="void" />
|
|
<param index="0" name="vertices" type="PackedFloat32Array" />
|
|
<param index="1" name="indices" type="PackedInt32Array" />
|
|
<description>
|
|
Appends arrays of [param vertices] and [param indices] at the end of the existing arrays. Adds the existing index as an offset to the appended indices.
|
|
</description>
|
|
</method>
|
|
<method name="clear">
|
|
<return type="void" />
|
|
<description>
|
|
Clears the internal data.
|
|
</description>
|
|
</method>
|
|
<method name="clear_projected_obstructions">
|
|
<return type="void" />
|
|
<description>
|
|
Clears all projected obstructions.
|
|
</description>
|
|
</method>
|
|
<method name="get_bounds">
|
|
<return type="AABB" />
|
|
<description>
|
|
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.
|
|
</description>
|
|
</method>
|
|
<method name="get_indices" qualifiers="const">
|
|
<return type="PackedInt32Array" />
|
|
<description>
|
|
Returns the parsed source geometry data indices array.
|
|
</description>
|
|
</method>
|
|
<method name="get_projected_obstructions" qualifiers="const">
|
|
<return type="Array" />
|
|
<description>
|
|
Returns the projected obstructions as an [Array] of dictionaries. Each [Dictionary] contains the following entries:
|
|
- [code]vertices[/code] - A [PackedFloat32Array] that defines the outline points of the projected shape.
|
|
- [code]elevation[/code] - A [float] that defines the projected shape placement on the y-axis.
|
|
- [code]height[/code] - A [float] that defines how much the projected shape is extruded along the y-axis.
|
|
- [code]carve[/code] - A [bool] that defines how the obstacle affects the navigation mesh baking. If [code]true[/code] the projected shape will not be affected by addition offsets, e.g. agent radius.
|
|
</description>
|
|
</method>
|
|
<method name="get_vertices" qualifiers="const">
|
|
<return type="PackedFloat32Array" />
|
|
<description>
|
|
Returns the parsed source geometry data vertices array.
|
|
</description>
|
|
</method>
|
|
<method name="has_data">
|
|
<return type="bool" />
|
|
<description>
|
|
Returns [code]true[/code] when parsed source geometry data exists.
|
|
</description>
|
|
</method>
|
|
<method name="merge">
|
|
<return type="void" />
|
|
<param index="0" name="other_geometry" type="NavigationMeshSourceGeometryData3D" />
|
|
<description>
|
|
Adds the geometry data of another [NavigationMeshSourceGeometryData3D] to the navigation mesh baking data.
|
|
</description>
|
|
</method>
|
|
<method name="set_indices">
|
|
<return type="void" />
|
|
<param index="0" name="indices" type="PackedInt32Array" />
|
|
<description>
|
|
Sets the parsed source geometry data indices. The indices need to be matched with appropriated vertices.
|
|
[b]Warning:[/b] Inappropriate data can crash the baking process of the involved third-party libraries.
|
|
</description>
|
|
</method>
|
|
<method name="set_projected_obstructions">
|
|
<return type="void" />
|
|
<param index="0" name="projected_obstructions" type="Array" />
|
|
<description>
|
|
Sets the projected obstructions with an Array of Dictionaries with the following key value pairs:
|
|
[codeblocks]
|
|
[gdscript]
|
|
"vertices" : PackedFloat32Array
|
|
"elevation" : float
|
|
"height" : float
|
|
"carve" : bool
|
|
[/gdscript]
|
|
[/codeblocks]
|
|
</description>
|
|
</method>
|
|
<method name="set_vertices">
|
|
<return type="void" />
|
|
<param index="0" name="vertices" type="PackedFloat32Array" />
|
|
<description>
|
|
Sets the parsed source geometry data vertices. The vertices need to be matched with appropriated indices.
|
|
[b]Warning:[/b] Inappropriate data can crash the baking process of the involved third-party libraries.
|
|
</description>
|
|
</method>
|
|
</methods>
|
|
</class>
|