Navigation2D

2D navigation and pathfinding node.

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 navpolyAdd.

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Functions

getClosestPoint
Vector2 getClosestPoint(Vector2 to_point)

Returns the navigation point closest to the point given. Points are in local coordinate space.

getClosestPointOwner
GodotObject getClosestPointOwner(Vector2 to_point)

Returns the owner of the NavigationPolygon which contains the navigation point closest to the point given. This is usually a NavigtionPolygonInstance. For polygons added via navpolyAdd, returns the owner that was given (or null if the owner parameter was omitted).

getSimplePath
PoolVector2Array getSimplePath(Vector2 start, Vector2 end, bool optimize)

Returns the path between two given points. Points are in local coordinate space. If optimize is true (the default), the path is smoothed by merging path segments where possible.

navpolyAdd
long navpolyAdd(NavigationPolygon mesh, Transform2D xform, GodotObject owner)

Adds a NavigationPolygon. Returns an ID for use with navpolyRemove or navpolySetTransform. If given, a Transform2D is applied to the polygon. The optional owner is used as return value for getClosestPointOwner.

navpolyRemove
void navpolyRemove(long id)

Removes the NavigationPolygon with the given ID.

navpolySetTransform
void navpolySetTransform(long id, Transform2D xform)

Sets the transform applied to the NavigationPolygon with the given ID.

opAssign
Navigation2D opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Navigation2D other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Static functions

_new
Navigation2D _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta