Skip to content

Commit

Permalink
Merge pull request #48395 from Duroxxigar/nav-backport
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Jan 5, 2022
2 parents 571e05d + 09bc9eb commit 0b54b3d
Show file tree
Hide file tree
Showing 109 changed files with 7,894 additions and 1,986 deletions.
5 changes: 5 additions & 0 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ Comment: Recast
Copyright: 2009, Mikko Mononen
License: Zlib

Files: ./thirdparty/rvo2/
Comment: RVO2
Copyright: 2016, University of North Carolina at Chapel Hill
License: Apache-2.0

Files: ./thirdparty/squish/
Comment: libSquish
Copyright: 2006, Simon Brown
Expand Down
1 change: 1 addition & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ opts.Add(BoolVariable("builtin_opus", "Use the built-in Opus library", True))
opts.Add(BoolVariable("builtin_pcre2", "Use the built-in PCRE2 library", True))
opts.Add(BoolVariable("builtin_pcre2_with_jit", "Use JIT compiler for the built-in PCRE2 library", True))
opts.Add(BoolVariable("builtin_recast", "Use the built-in Recast library", True))
opts.Add(BoolVariable("builtin_rvo2", "Use the built-in RVO2 library", True))
opts.Add(BoolVariable("builtin_squish", "Use the built-in squish library", True))
opts.Add(BoolVariable("builtin_xatlas", "Use the built-in xatlas library", True))
opts.Add(BoolVariable("builtin_zlib", "Use the built-in zlib library", True))
Expand Down
10 changes: 8 additions & 2 deletions doc/classes/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@
<member name="Marshalls" type="Marshalls" setter="" getter="">
The [Marshalls] singleton.
</member>
<member name="NavigationMeshGenerator" type="EditorNavigationMeshGenerator" setter="" getter="">
The [EditorNavigationMeshGenerator] singleton.
<member name="Navigation2DServer" type="Navigation2DServer" setter="" getter="">
The [Navigation2DServer] singleton.
</member>
<member name="NavigationMeshGenerator" type="NavigationMeshGenerator" setter="" getter="">
The [NavigationMeshGenerator] singleton.
</member>
<member name="NavigationServer" type="NavigationServer" setter="" getter="">
The [NavigationServer] singleton.
</member>
<member name="OS" type="OS" setter="" getter="">
The [OS] singleton.
Expand Down
54 changes: 20 additions & 34 deletions doc/classes/Navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,34 @@
Mesh-based navigation and pathfinding node.
</brief_description>
<description>
Provides navigation and pathfinding within a collection of [NavigationMesh]es. By default, these will be automatically collected from child [NavigationMeshInstance] nodes, but they can also be added on the fly with [method navmesh_add]. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on.
[b]Note:[/b] The current navigation system has many known issues and will not always return optimal paths as expected. These issues will be fixed in Godot 4.0.
Provides navigation and pathfinding within a collection of [NavigationMesh]es. By default, these will be automatically collected from child [NavigationMeshInstance] nodes. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on.
</description>
<tutorials>
<link title="3D Navmesh Demo">https://godotengine.org/asset-library/asset/124</link>
</tutorials>
<methods>
<method name="get_closest_point">
<method name="get_closest_point" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="to_point" type="Vector3" />
<description>
Returns the navigation point closest to the point given. Points are in local coordinate space.
</description>
</method>
<method name="get_closest_point_normal">
<method name="get_closest_point_normal" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="to_point" type="Vector3" />
<description>
Returns the surface normal at the navigation point closest to the point given. Useful for rotating a navigation agent according to the navigation mesh it moves on.
</description>
</method>
<method name="get_closest_point_owner">
<return type="Object" />
<method name="get_closest_point_owner" qualifiers="const">
<return type="RID" />
<argument index="0" name="to_point" type="Vector3" />
<description>
Returns the owner of the [NavigationMesh] which contains the navigation point closest to the point given. This is usually a [NavigationMeshInstance]. For meshes added via [method navmesh_add], returns the owner that was given (or [code]null[/code] if the [code]owner[/code] parameter was omitted).
Returns the owner of the [NavigationMesh] which contains the navigation point closest to the point given. This is usually a [NavigationMeshInstance].
</description>
</method>
<method name="get_closest_point_to_segment">
<method name="get_closest_point_to_segment" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="start" type="Vector3" />
<argument index="1" name="end" type="Vector3" />
Expand All @@ -41,42 +40,29 @@
Returns the navigation point closest to the given line segment. When enabling [code]use_collision[/code], only considers intersection points between segment and navigation meshes. If multiple intersection points are found, the one closest to the segment start point is returned.
</description>
</method>
<method name="get_simple_path">
<method name="get_rid" qualifiers="const">
<return type="RID" />
<description>
Returns the object's [RID].
</description>
</method>
<method name="get_simple_path" qualifiers="const">
<return type="PoolVector3Array" />
<argument index="0" name="start" type="Vector3" />
<argument index="1" name="end" type="Vector3" />
<argument index="2" name="optimize" type="bool" default="true" />
<description>
Returns the path between two given points. Points are in local coordinate space. If [code]optimize[/code] is [code]true[/code] (the default), the agent properties associated with each [NavigationMesh] (radius, height, etc.) are considered in the path calculation, otherwise they are ignored.
[b]Note:[/b] This method has known issues and will often return non-optimal paths. These issues will be fixed in Godot 4.0.
</description>
</method>
<method name="navmesh_add">
<return type="int" />
<argument index="0" name="mesh" type="NavigationMesh" />
<argument index="1" name="xform" type="Transform" />
<argument index="2" name="owner" type="Object" default="null" />
<description>
Adds a [NavigationMesh]. Returns an ID for use with [method navmesh_remove] or [method navmesh_set_transform]. If given, a [Transform2D] is applied to the polygon. The optional [code]owner[/code] is used as return value for [method get_closest_point_owner].
</description>
</method>
<method name="navmesh_remove">
<return type="void" />
<argument index="0" name="id" type="int" />
<description>
Removes the [NavigationMesh] with the given ID.
</description>
</method>
<method name="navmesh_set_transform">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="xform" type="Transform" />
<description>
Sets the transform applied to the [NavigationMesh] with the given ID.
</description>
</method>
</methods>
<members>
<member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="0.3">
The XZ plane cell size to use for fields.
</member>
<member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="5.0">
This value is used to detect the near edges to connect compatible regions.
</member>
<member name="up_vector" type="Vector3" setter="set_up_vector" getter="get_up_vector" default="Vector3( 0, 1, 0 )">
Defines which direction is up. By default, this is [code](0, 1, 0)[/code], which is the world's "up" direction.
</member>
Expand Down
52 changes: 20 additions & 32 deletions doc/classes/Navigation2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,50 @@
2D navigation and pathfinding node.
</brief_description>
<description>
Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of [NavigationPolygon] resources. By default, these are automatically collected from child [NavigationPolygonInstance] nodes, but they can also be added on the fly with [method navpoly_add].
[b]Note:[/b] The current navigation system has many known issues and will not always return optimal paths as expected. These issues will be fixed in Godot 4.0.
Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of [NavigationPolygon] resources. By default, these are automatically collected from child [NavigationPolygonInstance] nodes.
</description>
<tutorials>
<link title="2D Navigation Demo">https://godotengine.org/asset-library/asset/117</link>
</tutorials>
<methods>
<method name="get_closest_point">
<method name="get_closest_point" qualifiers="const">
<return type="Vector2" />
<argument index="0" name="to_point" type="Vector2" />
<description>
Returns the navigation point closest to the point given. Points are in local coordinate space.
</description>
</method>
<method name="get_closest_point_owner">
<return type="Object" />
<method name="get_closest_point_owner" qualifiers="const">
<return type="RID" />
<argument index="0" name="to_point" type="Vector2" />
<description>
Returns the owner of the [NavigationPolygon] which contains the navigation point closest to the point given. This is usually a [NavigationPolygonInstance]. For polygons added via [method navpoly_add], returns the owner that was given (or [code]null[/code] if the [code]owner[/code] parameter was omitted).
Returns the owner of the [NavigationPolygon] which contains the navigation point closest to the point given. This is usually a [NavigationPolygonInstance].
</description>
</method>
<method name="get_simple_path">
<method name="get_rid" qualifiers="const">
<return type="RID" />
<description>
Returns the object's [RID].
</description>
</method>
<method name="get_simple_path" qualifiers="const">
<return type="PoolVector2Array" />
<argument index="0" name="start" type="Vector2" />
<argument index="1" name="end" type="Vector2" />
<argument index="2" name="optimize" type="bool" default="true" />
<description>
Returns the path between two given points. Points are in local coordinate space. If [code]optimize[/code] is [code]true[/code] (the default), the path is smoothed by merging path segments where possible.
[b]Note:[/b] This method has known issues and will often return non-optimal paths. These issues will be fixed in Godot 4.0.
</description>
</method>
<method name="navpoly_add">
<return type="int" />
<argument index="0" name="mesh" type="NavigationPolygon" />
<argument index="1" name="xform" type="Transform2D" />
<argument index="2" name="owner" type="Object" default="null" />
<description>
Adds a [NavigationPolygon]. Returns an ID for use with [method navpoly_remove] or [method navpoly_set_transform]. If given, a [Transform2D] is applied to the polygon. The optional [code]owner[/code] is used as return value for [method get_closest_point_owner].
</description>
</method>
<method name="navpoly_remove">
<return type="void" />
<argument index="0" name="id" type="int" />
<description>
Removes the [NavigationPolygon] with the given ID.
</description>
</method>
<method name="navpoly_set_transform">
<return type="void" />
<argument index="0" name="id" type="int" />
<argument index="1" name="xform" type="Transform2D" />
<description>
Sets the transform applied to the [NavigationPolygon] with the given ID.
</description>
</method>
</methods>
<members>
<member name="cell_size" type="float" setter="set_cell_size" getter="get_cell_size" default="10.0">
The XY plane cell size to use for fields.
</member>
<member name="edge_connection_margin" type="float" setter="set_edge_connection_margin" getter="get_edge_connection_margin" default="100.0">
This value is used to detect the near edges to connect compatible regions.
</member>
</members>
<constants>
</constants>
</class>
Loading

0 comments on commit 0b54b3d

Please sign in to comment.