diff options
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/NavigationMeshGenerator.xml | 24 | ||||
-rw-r--r-- | doc/classes/NavigationMeshSourceGeometryData3D.xml | 77 | ||||
-rw-r--r-- | doc/classes/NavigationServer3D.xml | 20 |
3 files changed, 119 insertions, 2 deletions
diff --git a/doc/classes/NavigationMeshGenerator.xml b/doc/classes/NavigationMeshGenerator.xml index e10e23a5cf..f13d6b570a 100644 --- a/doc/classes/NavigationMeshGenerator.xml +++ b/doc/classes/NavigationMeshGenerator.xml @@ -14,12 +14,21 @@ <link title="Using NavigationMeshes">$DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.html</link> </tutorials> <methods> - <method name="bake"> + <method name="bake" is_deprecated="true"> <return type="void" /> <param index="0" name="navigation_mesh" type="NavigationMesh" /> <param index="1" name="root_node" type="Node" /> <description> - Bakes navigation data to the provided [param navigation_mesh] by parsing child nodes under the provided [param root_node] or a specific group of nodes for potential source geometry. The parse behavior can be controlled with the [member NavigationMesh.geometry_parsed_geometry_type] and [member NavigationMesh.geometry_source_geometry_mode] properties on the [NavigationMesh] resource. + The bake function is deprecated due to core threading changes. To upgrade existing code, first create a [NavigationMeshSourceGeometryData3D] resource. Use this resource with [method parse_source_geometry_data] to parse the SceneTree for nodes that should contribute to the navigation mesh baking. The SceneTree parsing needs to happen on the main thread. After the parsing is finished use the resource with [method bake_from_source_geometry_data] to bake a navigation mesh. + </description> + </method> + <method name="bake_from_source_geometry_data"> + <return type="void" /> + <param index="0" name="navigation_mesh" type="NavigationMesh" /> + <param index="1" name="source_geometry_data" type="NavigationMeshSourceGeometryData3D" /> + <param index="2" name="callback" type="Callable" /> + <description> + Bakes the provided [param navigation_mesh] with the data from the provided [param source_geometry_data]. After the process is finished the optional [param callback] will be called. </description> </method> <method name="clear"> @@ -29,5 +38,16 @@ Removes all polygons and vertices from the provided [param navigation_mesh] resource. </description> </method> + <method name="parse_source_geometry_data"> + <return type="void" /> + <param index="0" name="navigation_mesh" type="NavigationMesh" /> + <param index="1" name="source_geometry_data" type="NavigationMeshSourceGeometryData3D" /> + <param index="2" name="root_node" type="Node" /> + <param index="3" name="callback" type="Callable" /> + <description> + Parses the [SceneTree] for source geometry according to the properties of [param navigation_mesh]. Updates the provided [param source_geometry_data] resource with the resulting data. The resource can then be used to bake a navigation mesh with [method bake_from_source_geometry_data]. After the process is finished the optional [param callback] will be called. + [b]Note:[/b] This function needs to run on the main thread or with a deferred call as the SceneTree is not thread-safe. + </description> + </method> </methods> </class> diff --git a/doc/classes/NavigationMeshSourceGeometryData3D.xml b/doc/classes/NavigationMeshSourceGeometryData3D.xml new file mode 100644 index 0000000000..b929e82436 --- /dev/null +++ b/doc/classes/NavigationMeshSourceGeometryData3D.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<class name="NavigationMeshSourceGeometryData3D" inherits="Resource" is_experimental="true" version="4.1" 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] resource have no transform all vertex positions need to be offset by the node's transform using the [code]xform[/code] parameter. + </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] resource have no transform all vertex positions need to be offset by the node's transform using the [code]xform[/code] parameter. + </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] resource have no transform all vertex positions need to be offset by the node's transform using the [code]xform[/code] parameter. + </description> + </method> + <method name="clear"> + <return type="void" /> + <description> + Clears the internal data. + </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_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 [b]true[/b] when parsed source geometry data exists. + </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_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> diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml index 6f406aa629..79b8e30652 100644 --- a/doc/classes/NavigationServer3D.xml +++ b/doc/classes/NavigationServer3D.xml @@ -192,6 +192,15 @@ Replaces the internal velocity in the collision avoidance simulation with [param velocity] for the specified [param agent]. When an agent is teleported to a new position this function should be used in the same frame. If called frequently this function can get agents stuck. </description> </method> + <method name="bake_from_source_geometry_data"> + <return type="void" /> + <param index="0" name="navigation_mesh" type="NavigationMesh" /> + <param index="1" name="source_geometry_data" type="NavigationMeshSourceGeometryData3D" /> + <param index="2" name="callback" type="Callable" /> + <description> + Bakes the provided [param navigation_mesh] with the data from the provided [param source_geometry_data]. After the process is finished the optional [param callback] will be called. + </description> + </method> <method name="free_rid"> <return type="void" /> <param index="0" name="rid" type="RID" /> @@ -622,6 +631,17 @@ Sets the outline vertices for the obstacle. If the vertices are winded in clockwise order agents will be pushed in by the obstacle, else they will be pushed out. </description> </method> + <method name="parse_source_geometry_data"> + <return type="void" /> + <param index="0" name="navigation_mesh" type="NavigationMesh" /> + <param index="1" name="source_geometry_data" type="NavigationMeshSourceGeometryData3D" /> + <param index="2" name="root_node" type="Node" /> + <param index="3" name="callback" type="Callable" /> + <description> + Parses the [SceneTree] for source geometry according to the properties of [param navigation_mesh]. Updates the provided [param source_geometry_data] resource with the resulting data. The resource can then be used to bake a navigation mesh with [method bake_from_source_geometry_data]. After the process is finished the optional [param callback] will be called. + [b]Note:[/b] This function needs to run on the main thread or with a deferred call as the SceneTree is not thread-safe. + </description> + </method> <method name="query_path" qualifiers="const"> <return type="void" /> <param index="0" name="parameters" type="NavigationPathQueryParameters3D" /> |