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
ContourNavEdgeNavGeometry- 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.
NavPathOptionsNavPlacement- Where a mesh stands in the world: a vertex at cell
(i, j)is atoriginX + i * cellSize,originZ + j * cellSize. AVoxelFieldis one, which is whatbuildPolyMeshis meant to be handed. NavSteer- Following a route, which is the half of navigation that is not the search.
PolyMeshPortalGraphRegionFieldRegionSettingsVoxelField- 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.
buildPolyMeshbuildPortalGraph- A portal's midpoint is its graph node's position, and the graph is in metres as a path is.
buildRegionscolumnAt- The column index for a world position, or
-1outside the field. contourSelfIntersects- Whether any two non-adjacent segments of a closed loop cross.
createNavSteermaxDeviationOf- 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.-1beyond 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.
polyIsConvexpolyNeighbourpolyVertexCountregionOfSpanregionsLinkedspanCountspanFloor- 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. spanWalkablevoxeliseWalkable- Rasterise, then decide.