• Articles
  • Api Documentation
Show / Hide Table of Contents
  • AnyPath
    • Graphs
      • Extra
        • Line2D
        • Line3D
        • Triangle
      • HexGrid
        • HexGrid
        • HexGrid.Enumerator
        • HexGridCell
        • HexGridHeuristicProvider
        • HexGridType
      • Line
        • ClosestLineLocationPredicate
        • LineGraph
        • LineGraph.Edge
        • LineGraph.Enumerator
        • LineGraphBuilder
        • LineGraphBuilder.ProtoEdge
        • LineGraphDrawer
        • LineGraphHeuristic
        • LineGraphLocation
        • LineGraphPopulator
        • LineGraphProcessor
        • LineGraphWelder
        • SceneGraph
          • LineGraphNode
          • LineSceneGraph
          • LineSceneGraphEdge
          • SceneGraphNodeEditor
      • NavMesh
        • ClosestNavMeshLocationPredicate
        • CornerAndNormal
        • IUnrolledNavMeshGraphPortal
        • NavMeshGraph
        • NavMeshGraph.EnterCostAndFlags
        • NavMeshGraph.Enumerator
        • NavMeshGraphCorners
        • NavMeshGraphCorners3D
        • NavMeshGraphHeuristic
        • NavMeshGraphLocation
        • NavMeshGraphUnroller
        • NavMeshLineBitmaskMod
        • NavMeshLineMod
        • NavMeshPlaneBitmaskMod
        • NavMeshPlaneMod
        • NavMeshPopulator
        • NavMeshWelder
        • SSFA
        • UnrolledNavMeshGraphPortal
      • Node
        • NodeGraph
        • NodeGraphNode
      • PlatformerGraph
        • ClosestPlatformerGraphLocationPredicate
        • PlatformerGraph
        • PlatformerGraph.Enumerator
        • PlatformerGraphBuilder
        • PlatformerGraphBuilder.ProtoEdge
        • PlatformerGraphDrawer
        • PlatformerGraphHeuristic
        • PlatformerGraphLocation
        • PlatformerGraphPopulator
        • PlatformerGraphProcessor
        • PlatformerGraphWelder
        • SceneGraph
          • PlatformerSceneGraph
          • PlatformerSceneGraphEdge
          • PlatformerSceneGraphNode
          • SceneGraphNodeEditor
      • SquareGrid
        • SquareGrid
        • SquareGrid.Enumerator
        • SquareGridCell
        • SquareGridHeuristicProvider
        • SquareGridHeuristicProviderEightDirectional
        • SquareGridHeuristicProviderManhattanDistance
        • SquareGridType
      • VoxelGrid
        • VoxelGrid
        • VoxelGrid.DirCost
        • VoxelGrid.Enumerator
        • VoxelGridCell
        • VoxelGridDirectionFlags
        • VoxelGridDirectionMod
        • VoxelGridHeuristicProvider
        • VoxelGridHeuristicProviderManhattanDistance
    • Managed
      • ClearFinderFlags
      • FinderExtensions
      • IFinder
      • IOptionReserver<TOption>
      • IOptionValidator<TOption>
      • ImmutableFinderException
      • ManagedDisposeExtensions
      • Results
        • DijkstraResult<TNode>
        • Eval
        • Eval<TOption>
        • MultiEvalResult
        • MultiPathResult<TSeg>
        • Path<TSeg>
        • Path<TOption, TSeg>
    • Native
      • AStarCheapestOption
      • AStarEvalOptionResult
      • AStarEvalResult
      • AStarFindOptionResult
      • AStarFindPathResult
      • AStarOption
      • AStarStops
      • AStar<TNode>
      • ComposedGraph<TGraph, TNode>
      • Edge<TNode>
      • FlagBitmask<TNode>
      • IEdgeMod<TNode>
      • IGraph<TNode>
      • IHeuristicProvider<TNode>
      • INodeFlags
      • IPathProcessor<TNode, TSeg>
      • NativeListWrapper<TSeg>
      • NoEdgeMod<TNode>
      • NoProcessing<TNode>
      • OffsetInfo
      • ReversedGraph<TNode>
      • EdgeMods
        • AdditionalAndExcludeEdges<TNode>
        • AdditionalEdges<TNode>
        • ExcludeEdges<TNode>
        • ExcludeLocations<TNode>
      • Heuristics
        • ALTCompute<TGraph, TNode>
        • ALTSerialization
        • ALT<TNode>
        • LandmarkSelection<TGraph, TNode, TEnumerator>
      • Util
        • IRefComparer<T>
        • NativeMinHeap<T, TComp>
        • NativeRefMinHeap<T, TComp>

Class PlatformerGraphDrawer

Makes it extremely easy to 'draw' a platformer graph. Just add lines/edges and close enough vertices will automatically be joined together.

Inheritance
object
PlatformerGraphDrawer
Namespace: AnyPath.Graphs.PlatformerGraph
Assembly: AnyPath.dll
Syntax
public class PlatformerGraphDrawer
Examples
void Example()
{
    // create a drawer which merges vertices that are closer than .1f
    var drawer = new PlatformerGraphDrawer(.1f);

    // draw a square
    drawer.AddUndirected(new float2(0, 0), new float2(1, 0));
    drawer.AddUndirected(new float2(1, 0), new float2(1, 1));
    drawer.AddUndirected(new float2(1, 1), new float2(0, 1));
    drawer.AddUndirected(new float2(0, 1), new float2(0, 0));

    // create our graph
    var graph = new PlatformerGraph(Allocator.Persistent);

    // populate it with our square
    graph.Populate(drawer.Vertices, drawer.UndirectedEdges);
}

Constructors

PlatformerGraphDrawer(float)

Construct a platformer graph drawer

Declaration
public PlatformerGraphDrawer(float weldThreshold)
Parameters
Type Name Description
float weldThreshold

Approx maximum distance vertices can have in order to be joined/welded together

Properties

DirectedEdges

All edges that have been added as directed edges, use to populate the graph

Declaration
public IReadOnlyList<PlatformerGraph.Edge> DirectedEdges { get; }
Property Value
Type Description
IReadOnlyList<PlatformerGraph.Edge>

UndirectedEdges

All edges that have been added as undirected, use to populate the graph

Declaration
public IReadOnlyList<PlatformerGraph.Edge> UndirectedEdges { get; }
Property Value
Type Description
IReadOnlyList<PlatformerGraph.Edge>

Vertices

The welded vertices, use to populate the graph

Declaration
public IReadOnlyList<float2> Vertices { get; }
Property Value
Type Description
IReadOnlyList<float2>

Methods

AddDirected(float2, float2)

Draw a directed edge

Declaration
public void AddDirected(float2 from, float2 to)
Parameters
Type Name Description
float2 from
float2 to

AddDirected(float2, float2, float, int)

Draw a directed edge with some additional traversal cost and flags associated with it

Declaration
public void AddDirected(float2 from, float2 to, float enterCost, int flags = 0)
Parameters
Type Name Description
float2 from
float2 to
float enterCost
int flags

AddUndirected(float2, float2)

Draw an undirected edge

Declaration
public void AddUndirected(float2 from, float2 to)
Parameters
Type Name Description
float2 from
float2 to

AddUndirected(float2, float2, float, int)

Draw an undirected edge with some additional traversal cost and flags associated with it

Declaration
public void AddUndirected(float2 from, float2 to, float enterCost, int flags = 0)
Parameters
Type Name Description
float2 from
float2 to
float enterCost
int flags

Extension Methods

FinderExtensions.AddOption<T, TNode, TOption>(T, TOption, TNode, TNode)
FinderExtensions.AddOptions<T, TNode, TOption>(T, IEnumerable<TOption>, TNode, Func<TOption, TNode>)
FinderExtensions.AddRange<T, TNode, TOption>(T, IEnumerable<TOption>, TNode, Func<TOption, TNode>)
FinderExtensions.AddRequest<T, TNode>(T, TNode, TNode)
FinderExtensions.AddRequests<T, TNode>(T, IEnumerable<TNode>)
FinderExtensions.AddStop<T, TNode>(T, TNode)
FinderExtensions.AddStops<T, TNode>(T, IEnumerable<TNode>)
FinderExtensions.SetComparer<T, TOption>(T, IComparer<TOption>)
FinderExtensions.SetEdgeMod<T, TMod>(T, TMod)
FinderExtensions.SetGraph<T, TGraph>(T, TGraph)
FinderExtensions.SetHeuristicProvider<T, TH>(T, TH)
FinderExtensions.SetPathProcessor<T, TProc>(T, TProc)
FinderExtensions.SetReserver<T, TOption>(T, IOptionReserver<TOption>)
FinderExtensions.SetStartAndGoal<T, TNode>(T, TNode, TNode)
FinderExtensions.SetValidator<T, TOption>(T, IOptionValidator<TOption>)
In This Article
Back to top Generated by DocFX