Class NavmeshBase Extends NavGraph, INavmesh, INavmeshHolder, ITransformedGraph, IRaycastableGraph

Public Abstract

Base class for RecastGraph and NavMeshGraph.

Public Methods

CalculateTransform ()

Returns a new transform which transforms graph space to world space.

Public Abstract
EndBatchTileUpdate ()

End batch updating of tiles.

Public
GetNearest (position, constraint, hint)

Returns the nearest node to a position using the specified NNConstraint.

Public
GetNearestForce (position, constraint)

Returns the nearest node to a position using the specified constraint .

Public
GetNodes (action)

Calls a delegate with all nodes in the graph.

Public
GetTile (x, z)

Tile at the specified x, z coordinate pair.

Public
GetTileBounds (rect)

Returns a bounds object with the bounding box of a group of tiles.

Public
GetTileBounds (x, z, width=1, depth=1)

Returns a bounds object with the bounding box of a group of tiles.

Public
GetTileBoundsInGraphSpace (rect)
Public
GetTileBoundsInGraphSpace (x, z, width=1, depth=1)

Returns an XZ bounds object with the bounds of a group of tiles in graph space.

Public
GetTileCoordinates (position)

Returns the tile coordinate which contains the specified position.

Public
GetTileCoordinates (tileIndex, x, z)

Tile coordinates from a tile index.

Public
GetTiles ()

All tiles.

Public
GetTouchingTiles (bounds, margin=0)

Returns a rect containing the indices of all tiles touching the specified bounds.

Public
GetTouchingTilesInGraphSpace (rect)

Returns a rect containing the indices of all tiles touching the specified bounds.

Public
GetTouchingTilesRound (bounds)

Returns a rect containing the indices of all tiles by rounding the specified bounds to tile borders.

Public
GetVertex (index)

Vertex coordinate for the specified vertex index.

Public
GetVertexArrayIndex (index)
Public
GetVertexInGraphSpace (index)

Vertex coordinate in graph space for the specified vertex index.

Public
Linecast (origin, end)

Returns if there is an obstacle between origin and end on the graph.

Public
Linecast (origin, end, hint)

Returns if there is an obstacle between origin and end on the graph.

Public
Linecast (origin, end, hint, hit)

Returns if there is an obstacle between origin and end on the graph.

Public
Linecast (origin, end, hint, hit, trace)

Returns if there is an obstacle between origin and end on the graph.

Public
NavmeshBase ()
OnDrawGizmos (gizmos, drawNodes)
Public
PointOnNavmesh (position, constraint)

Finds the first node which contains position.

Public
RelocateNodes (deltaMatrix)

Moves the nodes in this graph.

Public
RelocateNodes (newTransform)

Moves the nodes in this graph.

Public
ReplaceTile (x, z, verts, tris)

Replace tile at index with nodes created from specified navmesh.

Public
StartBatchTileUpdate ()

Start batch updating of tiles.

Public

Public Static Methods

GetTileIndex (index)

Tile index from a vertex index.

Public Static
Linecast (graph, origin, end, hint, hit)

Returns if there is an obstacle between origin and end on the graph.

Public Static
Linecast (graph, origin, end, hint, hit, trace)

Returns if there is an obstacle between origin and end on the graph.

Public Static

Public Variables

enableNavmeshCutting

Should navmesh cuts affect this graph.

Public
forcedBoundsSize

Size of the bounding box.

Public
nearestSearchOnlyXZ

Perform nearest node searches in XZ space only.

Public
OnRecalculatedTiles

Called when tiles have been completely recalculated.

Public
showMeshOutline

Show an outline of the polygons in the Unity Editor.

Public
showMeshSurface

Show the surface of the navmesh.

Public
showNodeConnections

Show the connections between the polygons in the Unity Editor.

Public
TileIndexMask
Public
TileIndexOffset
Public
TileWorldSizeX

Size of a tile in world units along the X axis.

Public Abstract
TileWorldSizeZ

Size of a tile in world units along the Z axis.

Public Abstract
tileXCount

Number of tiles along the X-axis.

Public
tileZCount

Number of tiles along the Z-axis.

Public
transform

Determines how the graph transforms graph space to world space.

Public
VertexIndexMask
Public

Inherited Public Members

active

Reference to the AstarPath object in the scene.

Public
CountNodes ()

Number of nodes in the graph.

Public
drawGizmos

Enable to draw gizmos in the Unity scene view.

Public
GetNearest (position)

Returns the nearest node to a position.

Public
GetNearest (position, constraint)

Returns the nearest node to a position using the specified NNConstraint.

Public
GetNodes (action)

Calls a delegate with all nodes in the graph until the delegate returns false.

Public
graphIndex

Index of the graph, used for identification purposes.

Public
guid

Used as an ID of the graph, considered to be unique.

Public
infoScreenOpen

Used in the editor to check if the info screen is open.

Public
initialPenalty

Default penalty to apply to all nodes.

Public
name

Name of the graph.

Public
OnDrawGizmos (gizmos, drawNodes)

Draw gizmos for the graph.

Public
open

Is the graph open in the editor.

Public
Scan ()

Scan the graph.

Public

Private/Protected Members

batchNodesToDestroy

List of nodes that are going to be destroyed as part of a batch update.

Private
batchTileUpdate

Currently updating tiles in a batch.

Private
batchUpdatedTiles

List of tiles updating during batch.

Private
ClearTile (x, z)

Clear the tile at the specified coordinate.

Protected
ConnectTiles (tile1, tile2)

Generate connections between the two tiles.

Protected
ConnectTileWithNeighbours (tile, onlyUnflagged=…)
Protected
CreateNavmeshOutlineVisualization (tiles, startTile, endTile, helper)

Creates an outline of the navmesh for use in OnDrawGizmos in the editor.

Private Static
CreateNavmeshSurfaceVisualization (tiles, startTile, endTile, helper)

Creates a mesh of the surfaces of the navmesh for use in OnDrawGizmos in the editor.

Private
CreateNodeConnections (nodes)

Create connections between all nodes.

Protected Static
CreateNodes (buffer, tris, tileIndex, graphIndex)
Protected
DeserializeExtraInfo (ctx)

Deserializes graph type specific node data.

Protected
DestroyAllNodes ()

Destroys all nodes in the graph.

Protected
DestroyNodes (nodes)

Destroy several nodes simultaneously.

Private
DrawUnwalkableNodes (size)
Protected
exists

True if the graph exists, false if it has been destroyed.

Package
FillWithEmptyTiles ()

Fills graph with tiles created by NewEmptyTile.

Protected
LinecastShapeEdgeLookup

Used to optimize linecasts by precomputing some values.

Private Static Readonly
MaxTileConnectionEdgeDistance

Maximum (vertical) distance between the sides of two nodes for them to be connected across a tile edge.

Protected Abstract
NavmeshBase ()
navmeshUpdateData

Handles navmesh cutting.

NewEmptyTile (x, z)

Creates a single new empty tile.

Protected
NNConstraintDistanceXZ
Private Static Readonly
NNConstraintNone

Cached NNConstraint.None to reduce allocations.

Private Static Readonly
nodeRecyclingHashBuffer

Temporary buffer used in PrepareNodeRecycling.

Private
OnDestroy ()

Function for cleaning up references.

Protected
PostDeserialization (ctx)

Called after all deserialization has been done for all graphs.

Protected
PrepareNodeRecycling (x, z, verts, tris, recycledNodeBuffer)

Reuse nodes that keep the exact same vertices after a tile replacement.

Private
RecalculateNormals

Determines how normals are calculated.

Protected Abstract
RemoveConnectionsFromTile (tile)
Protected
RemoveConnectionsFromTo (a, b)
Protected
SerializeExtraInfo (ctx)

Serializes Node Info.

Protected
tiles

All tiles.

Protected
transform
Private
TryConnect (tileIdx1, tileIdx2)
Private