mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Add 2D navigation mesh baking
Adds 2D navigation mesh baking.
This commit is contained in:
@@ -182,6 +182,24 @@
|
||||
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 far away 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_polygon" type="NavigationPolygon" />
|
||||
<param index="1" name="source_geometry_data" type="NavigationMeshSourceGeometryData2D" />
|
||||
<param index="2" name="callback" type="Callable" default="Callable()" />
|
||||
<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_from_source_geometry_data_async">
|
||||
<return type="void" />
|
||||
<param index="0" name="navigation_polygon" type="NavigationPolygon" />
|
||||
<param index="1" name="source_geometry_data" type="NavigationMeshSourceGeometryData2D" />
|
||||
<param index="2" name="callback" type="Callable" default="Callable()" />
|
||||
<description>
|
||||
Bakes the provided [param navigation_polygon] with the data from the provided [param source_geometry_data] as an async task running on a background thread. 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" />
|
||||
@@ -579,6 +597,18 @@
|
||||
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_polygon" type="NavigationPolygon" />
|
||||
<param index="1" name="source_geometry_data" type="NavigationMeshSourceGeometryData2D" />
|
||||
<param index="2" name="root_node" type="Node" />
|
||||
<param index="3" name="callback" type="Callable" default="Callable()" />
|
||||
<description>
|
||||
Parses the [SceneTree] for source geometry according to the properties of [param navigation_polygon]. 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.
|
||||
[b]Performance:[/b] While convenient, reading data arrays from [Mesh] resources can affect the frame rate negatively. The data needs to be received from the GPU, stalling the [RenderingServer] in the process. For performance prefer the use of e.g. collision shapes or creating the data arrays entirely in code.
|
||||
</description>
|
||||
</method>
|
||||
<method name="query_path" qualifiers="const">
|
||||
<return type="void" />
|
||||
<param index="0" name="parameters" type="NavigationPathQueryParameters2D" />
|
||||
|
||||
Reference in New Issue
Block a user