<?xml version="1.0" encoding="UTF-8" ?>
<class name="NavigationMeshGenerator" inherits="Object" version="4.2">
	<brief_description>
		Server for navigation mesh baking and source geometry parsing.
	</brief_description>
	<description>
		Server for navigation mesh baking and source geometry parsing. [NavigationMesh] baking is the process of creating a simplified mesh used for pathfinding out of (complex) level geometry. For this process, the [NavigationMeshGenerator] parses scene geometry from nodes and uses this information for the creation of the final navigation mesh according to bake parameters.
		Source geometry parsing and navigation mesh baking are costly operations. It is best to do them infrequently and with the help of background threads at runtime. Source geometry parsing has to finish on the exact frame it was started even when using threads, as the scene tree is not safe to parse when doing updates, and also, by nature, the scene tree itself is not thread-safe. If the amount of geometry that must be parsed is too big, framerate issues may occur.
		To work around the runtime framerate issues, the source geometry can be parsed to a [NavigationMeshSourceGeometryData2D] or a [NavigationMeshSourceGeometryData3D] resource. This resource can later be (re)used at runtime to bake multiple navigation meshes with different parameters in background threads without touching the scene tree again (assuming the nodes that contribute source geometry have not changed).
	</description>
	<tutorials>
		<link title="Using NavigationMeshes">$DOCS_URL/tutorials/navigation/navigation_using_navigationmeshes.md</link>
	</tutorials>
	<methods>
		<method name="bake_2d_from_source_geometry_data">
			<return type="void" />
			<argument index="0" name="navigation_polygon" type="NavigationPolygon" />
			<argument index="1" name="source_geometry_data" type="NavigationMeshSourceGeometryData2D" />
			<argument index="2" name="callback" type="FuncRef" default="null" />
			<description>
				Bakes the provided [param navigation_polygon] 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="bake_3d_from_source_geometry_data">
			<return type="void" />
			<argument index="0" name="navigation_mesh" type="NavigationMesh" />
			<argument index="1" name="source_geometry_data" type="NavigationMeshSourceGeometryData3D" />
			<argument index="2" name="callback" type="FuncRef" default="null" />
			<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="is_navigation_mesh_baking" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="navigation_mesh" type="NavigationMesh" />
			<description>
				Returns [code]true[/code] if [param navigation_mesh] is currently baking or geometry parsing.
			</description>
		</method>
		<method name="is_navigation_polygon_baking" qualifiers="const">
			<return type="bool" />
			<argument index="0" name="navigation_polygon" type="NavigationPolygon" />
			<description>
				Returns [code]true[/code] if [param navigation_polygon] is currently baking or geometry parsing.
			</description>
		</method>
		<method name="parse_2d_source_geometry_data">
			<return type="NavigationMeshSourceGeometryData2D" />
			<argument index="0" name="navigation_polygon" type="NavigationPolygon" />
			<argument index="1" name="root_node" type="Node" />
			<argument index="2" name="callback" type="FuncRef" default="null" />
			<description>
				Parses the [SceneTree] (not thread-safe) for source geometry according to the properties of [param navigation_polygon] and returns a [NavigationMeshSourceGeometryData2D] that can be used to bake a navigation mesh. After the process is finished the optional [param callback] will be called.
			</description>
		</method>
		<method name="parse_3d_source_geometry_data">
			<return type="NavigationMeshSourceGeometryData3D" />
			<argument index="0" name="navigation_mesh" type="NavigationMesh" />
			<argument index="1" name="root_node" type="Node" />
			<argument index="2" name="callback" type="FuncRef" default="null" />
			<description>
				Parses the [SceneTree] (not thread-safe) for source geometry according to the properties of [param navigation_mesh] and returns a [NavigationMeshSourceGeometryData2D] that can be used to bake a navigation mesh. After the process is finished the optional [param callback] will be called.
			</description>
		</method>
		<method name="parse_and_bake_2d">
			<return type="void" />
			<argument index="0" name="navigation_polygon" type="NavigationPolygon" />
			<argument index="1" name="root_node" type="Node" />
			<argument index="2" name="callback" type="FuncRef" default="null" />
			<description>
				Uses both [method parse_2d_source_geometry_data] and [method bake_2d_from_source_geometry_data] in sequence. After the process is finished the optional [param callback] will be called.
			</description>
		</method>
		<method name="parse_and_bake_3d">
			<return type="void" />
			<argument index="0" name="navigation_mesh" type="NavigationMesh" />
			<argument index="1" name="root_node" type="Node" />
			<argument index="2" name="callback" type="FuncRef" default="null" />
			<description>
				Uses both [method parse_3d_source_geometry_data] and [method bake_3d_from_source_geometry_data] in sequence. After the process is finished the optional [param callback] will be called.
			</description>
		</method>
		<method name="register_geometry_parser_2d">
			<return type="void" />
			<argument index="0" name="geometry_parser" type="NavigationGeometryParser2D" />
			<description>
				Registers a 2d navigation geometry parser to contribute geometry data from parser specified node class(es) for navigation mesh baking.
			</description>
		</method>
		<method name="register_geometry_parser_3d">
			<return type="void" />
			<argument index="0" name="geometry_parser" type="NavigationGeometryParser3D" />
			<description>
				Registers a 3d navigation geometry parser to contribute geometry data from parser specified node class(es) for navigation mesh baking.
			</description>
		</method>
		<method name="unregister_geometry_parser_2d">
			<return type="void" />
			<argument index="0" name="geometry_parser" type="NavigationGeometryParser2D" />
			<description>
				Unregisters the specific 2d navigation geometry parser.
			</description>
		</method>
		<method name="unregister_geometry_parser_3d">
			<return type="void" />
			<argument index="0" name="geometry_parser" type="NavigationGeometryParser3D" />
			<description>
				Unregisters the specific 3d navigation geometry parser.
			</description>
		</method>
	</methods>
	<constants>
	</constants>
</class>
