Navigation

Mesh-based navigation and pathfinding node.

Provides navigation and pathfinding within a collection of NavigationMeshes. By default these will be automatically collected from child NavigationMeshInstance nodes, but they can also be added on the fly with navmeshAdd. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on.

Members

Aliases

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

Functions

getClosestPoint
Vector3 getClosestPoint(Vector3 to_point)

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

getClosestPointNormal
Vector3 getClosestPointNormal(Vector3 to_point)

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.

getClosestPointOwner
GodotObject getClosestPointOwner(Vector3 to_point)

Returns the owner of the NavigationMesh which contains the navigation point closest to the point given. This is usually a NavigtionMeshInstance. For meshes added via navmeshAdd, returns the owner that was given (or null if the owner parameter was omitted).

getClosestPointToSegment
Vector3 getClosestPointToSegment(Vector3 start, Vector3 end, bool use_collision)

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.

getSimplePath
PoolVector3Array getSimplePath(Vector3 start, Vector3 end, bool optimize)

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 (raidus, height, etc.) are considered in the path calculation, otherwise they are ignored.

getUpVector
Vector3 getUpVector()
navmeshAdd
long navmeshAdd(NavigationMesh mesh, Transform xform, GodotObject owner)

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

navmeshRemove
void navmeshRemove(long id)

Removes the NavigationMesh with the given ID.

navmeshSetTransform
void navmeshSetTransform(long id, Transform xform)

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

opAssign
Navigation opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Navigation 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.
setUpVector
void setUpVector(Vector3 up)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

upVector
Vector3 upVector [@property getter]
Vector3 upVector [@property setter]

Defines which direction is up. By default this is (0, 1, 0), which is the world up direction.

Static functions

_new
Navigation _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