Simulation

Navigation

41 symbols, imported from @driftengine/nav.

Explained in Navigation.

Classes

NavMeshQuery
A query, holding everything a search needs so that running one allocates nothing.
NavPath
A route being walked: the nodes, and how far along them the agent is.
NavSearch
A* over a NavGraph, allocating nothing per query and answering the same route every time.

Interfaces

Contour
NavEdge
NavGeometry
Geometry to a field of where an agent of a given size could stand.
NavGraph
A graph to path over: nodes somewhere in the world, edges between them, and a cost per edge.
NavPathOptions
NavPlacement
Where a mesh stands in the world: a vertex at cell (i, j) is at originX + i * cellSize, originZ + j * cellSize. A VoxelField is one, which is what buildPolyMesh is meant to be handed.
NavSteer
Following a route, which is the half of navigation that is not the search.
PolyMesh
PortalGraph
RegionField
RegionSettings
VoxelField
Walkable surfaces as spans, in columns on a horizontal grid.
VoxeliseSettings

Functions

attachGoal
Point the portals of the goal's polygon at the goal node, and let the previous ones go.
attachStart
Point the start node at the portals of the polygon holding it.
buildContours
One closed loop per region, holes bridged into it, simplified.
buildNavGraph
Build the graph, checking the two things that make a wrong route look like a working one.
buildPolyMesh
buildPortalGraph
A portal's midpoint is its graph node's position, and the graph is in metres as a path is.
buildRegions
columnAt
The column index for a world position, or -1 outside the field.
contourSelfIntersects
Whether any two non-adjacent segments of a closed loop cross.
createNavSteer
maxDeviationOf
The furthest any raw point sits from the simplified loop. What the deviation bound means.
nearestNavNode
The node nearest a world position, or −1 for a graph with none in reach.
nearestPoly
The polygon a point is in, or the nearest within extent. -1 beyond it. The point and the extent are in metres, which the mesh's placement turns into its cells.
polyArea
The shoelace area, which is positive for the winding this builds and zero for a degenerate.
polyIsConvex
polyNeighbour
polyVertexCount
regionOfSpan
regionsLinked
spanCount
spanFloor
The world height of a span's floor, by column index and span number.
spanIndexAt
The index of the at-th span in a column, or -1. Spans are numbered across the whole field.
spanWalkable
voxeliseWalkable
Rasterise, then decide.

Constants

NO_NEIGHBOUR