Navigation¶
Inherits: Spatial < Node < Object
Mesh-based navigation and pathfinding node.
Description¶
Deprecated. Navigation node and get_simple_path are deprecated and will be removed in a future version. Use NavigationServer.map_get_path instead.
Provides navigation and pathfinding within a collection of NavigationMeshes. 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.
Tutorials¶
Properties¶
|
||
|
||
|
||
|
||
|
Methods¶
get_closest_point ( Vector3 to_point ) const |
|
get_closest_point_normal ( Vector3 to_point ) const |
|
get_closest_point_owner ( Vector3 to_point ) const |
|
get_closest_point_to_segment ( Vector3 start, Vector3 end, bool use_collision=false ) const |
|
get_rid ( ) const |
|
get_simple_path ( Vector3 start, Vector3 end, bool optimize=true ) const |
Signals¶
map_changed ( RID map )
Emitted when a navigation map is updated, when a region moves or is modified.
Property Descriptions¶
float cell_height = 0.25
The cell height to use for fields.
float cell_size = 0.25
The XZ plane cell size to use for fields.
float edge_connection_margin = 0.25
This value is used to detect the near edges to connect compatible regions.
int navigation_layers = 1
A bitfield determining all navigation map layers the navigation can use on a get_simple_path path query.
Vector3 up_vector = Vector3( 0, 1, 0 )
Defines which direction is up. By default, this is (0, 1, 0)
, which is the world's "up" direction.
Method Descriptions¶
Vector3 get_closest_point ( Vector3 to_point ) const
Returns the navigation point closest to the point given. Points are in local coordinate space.
Vector3 get_closest_point_normal ( Vector3 to_point ) const
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.
RID get_closest_point_owner ( Vector3 to_point ) const
Returns the owner of the NavigationMesh which contains the navigation point closest to the point given. This is usually a NavigationMeshInstance.
Vector3 get_closest_point_to_segment ( Vector3 start, Vector3 end, bool use_collision=false ) const
Returns the navigation point closest to the given line segment. When enabling use_collision
, 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.
RID get_rid ( ) const
Returns the RID of the navigation map on the NavigationServer.
PoolVector3Array get_simple_path ( Vector3 start, Vector3 end, bool optimize=true ) const
Deprecated. Navigation node and get_simple_path are deprecated and will be removed in a future version. Use NavigationServer.map_get_path instead.
Returns the path between two given points. Points are in local coordinate space. If optimize
is true
(the default), the agent properties associated with each NavigationMesh (radius, height, etc.) are considered in the path calculation, otherwise they are ignored.