A* Pathfinding Project  4.1.0
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
GraphVisualizationUtilities Class Reference

Contains useful functions for visualizing graphs. More...

Detailed Description

Contains useful functions for visualizing graphs.

This class works a lot with the Node class, a useful function to get nodes is AstarPath.GetNearest.

See Also
AstarPath.GetNearest
Pathfinding.Utils.GraphUpdateUtilities
Pathfinding.Utils.PathUtilities
ConstantPath

Static Public Member Functions

static void CreateNavmeshSurfaceVisualization (GraphNode[] nodes, Mesh mesh, System.Func< GraphNode, Color32 > color)
 Creates a mesh of the surfaces of group of nodes.
 
static void CreateNavmeshSurfaceVisualization (GraphNode[] nodes, out List< Vector3 > vertices, out List< int > triangles, out List< Color32 > colors, System.Func< GraphNode, Color32 > color)
 Creates a mesh of the surfaces of the navmesh tile.
 
static int GetSurface (GraphNode node, List< Vector3 > vertexBuffer, List< int > triangleBuffer)
 Vertices and triangles for the surface of a node.
 

Member Function Documentation

static void CreateNavmeshSurfaceVisualization ( GraphNode[]  nodes,
Mesh  mesh,
System.Func< GraphNode, Color32 >  color 
)
static

Creates a mesh of the surfaces of group of nodes.

Parameters
nodesThe nodes to create a mesh of
meshA mesh which will be OVERWRITTEN with the mesh representing the nodes' surface
colorA delegate which should return a color
static void CreateNavmeshSurfaceVisualization ( GraphNode[]  nodes,
out List< Vector3 >  vertices,
out List< int >  triangles,
out List< Color32 >  colors,
System.Func< GraphNode, Color32 >  color 
)
static

Creates a mesh of the surfaces of the navmesh tile.

Parameters
nodesThe nodes to create a mesh of
verticesA list with all vertices of the mesh.
trianglesAn list of all triangles in the mesh.
colorsAn list of all colors in the mesh.
colorA delegate which should return a color for each node
static int GetSurface ( GraphNode  node,
List< Vector3 >  vertexBuffer,
List< int >  triangleBuffer 
)
static

Vertices and triangles for the surface of a node.

The vertices and triangles will be added to the buffers in the same format as if they are going to be used for a Unity mesh.

Only GridNode and TriangleMeshNode (recast/navmesh graph) are supported since they are the only node types that have a welll defined surface.

Returns
Number of vertices added to the vertex buffer

The documentation for this class was generated from the following file: