• 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 NavMeshWelder

Utility to weld close vertices in a mesh together.

Inheritance
object
NavMeshWelder
Namespace: AnyPath.Graphs.NavMesh
Assembly: AnyPath.dll
Syntax
public class NavMeshWelder

Constructors

NavMeshWelder()

Declaration
public NavMeshWelder()

Methods

ScheduleWeld(NativeArray<Vector3>, NativeArray<int>, NativeList<Vector3>, float, JobHandle)

Finds vertices that are close together in a mesh and welds them together. Depending on your mesh this may or may not be neccessary for correct pathfinding, as neighbouring triangles need to share the same vertices.

Declaration
public static JobHandle ScheduleWeld(NativeArray<Vector3> inVertices, NativeArray<int> inOutIndices, NativeList<Vector3> outVertices, float weldThreshold = 0.001, JobHandle dependsOn = default)
Parameters
Type Name Description
NativeArray<Vector3> inVertices

Original vertices of the mesh

NativeArray<int> inOutIndices

The triangle indices of the mesh. This array is modified in place and will contain the new indices afterwards.

NativeList<Vector3> outVertices

The new unique vertices of the welded mesh, use in conjunction with inOutIndices. This list is not cleared beforehand

float weldThreshold

Distance below which two vertices will be welded together

JobHandle dependsOn

Optional job dependency for the scheduled job

Returns
Type Description
JobHandle
Remarks

This method schedules a burst compiled job doing the work and can be run on another thread.

ScheduleWeld(NativeList<Vector3>, NativeArray<int>, float, JobHandle)

Finds vertices that are close together in a mesh and welds them together. Depending on your mesh this may or may not be neccessary for correct pathfinding, as neighbouring triangles need to share the same vertices.

Declaration
public static JobHandle ScheduleWeld(NativeList<Vector3> inOutVertices, NativeArray<int> inOutIndices, float weldThreshold = 0.001, JobHandle dependsOn = default)
Parameters
Type Name Description
NativeList<Vector3> inOutVertices

The vertices to weld together. This list contains the modified vertices afterwards.

NativeArray<int> inOutIndices

The triangle indices of the mesh. This array is modified in place and will contain the new indices afterwards.

float weldThreshold

Distance below which two vertices will be welded together

JobHandle dependsOn

Optional job dependency for the scheduled job

Returns
Type Description
JobHandle
Remarks

This method schedules a burst compiled job doing the work and can be run on another thread.

Weld(List<Vector3>, List<int>, List<Vector3>, float)

Finds vertices that are close together in a mesh and welds them together. Depending on your mesh this may or may not be neccessary for correct pathfinding, as neighbouring triangles need to share the same vertices.

Declaration
public static void Weld(List<Vector3> inOutVertices, List<int> inOutIndices, List<Vector3> outVertices, float weldThreshold)
Parameters
Type Name Description
List<Vector3> inOutVertices

The vertices to weld together. This list contains the modified vertices afterwards.

List<int> inOutIndices

The triangle indices to weld together. This list contains the modified triangles afterwards.

List<Vector3> outVertices

List to output the new vertices too, this list should be manually cleared beforehand

float weldThreshold

Distance below which two vertices will be welded together

Remarks

For best performance, use the native overloads as they can utilize Unity's burst compiler for significant speed gains

Weld(List<Vector3>, List<int>, float)

Finds vertices that are close together in a mesh and welds them together. Depending on your mesh this may or may not be neccessary for correct pathfinding, as neighbouring triangles need to share the same vertices.

Declaration
public static void Weld(List<Vector3> inOutVertices, List<int> inOutIndices, float weldThreshold)
Parameters
Type Name Description
List<Vector3> inOutVertices

The vertices to weld together. This list contains the modified vertices afterwards.

List<int> inOutIndices

The triangle indices to weld together. This list contains the modified triangles afterwards.

float weldThreshold

Distance below which two vertices will be welded together

Remarks

For best performance, use the native overloads as they can utilize Unity's burst compiler for significant speed gains

Weld(NativeArray<Vector3>, NativeArray<int>, NativeList<Vector3>, NativeHashMap<int3, int>, NativeHashMap<int, int>, float)

Finds vertices that are close together in a mesh and welds them together. Depending on your mesh this may or may not be neccessary for correct pathfinding, as neighbouring triangles need to share the same vertices.

Declaration
public static void Weld(NativeArray<Vector3> inVertices, NativeArray<int> inOutIndices, NativeList<Vector3> outVertices, NativeHashMap<int3, int> buckets, NativeHashMap<int, int> shiftedIndices, float weldThreshold = 0.001)
Parameters
Type Name Description
NativeArray<Vector3> inVertices

Original vertices of the mesh

NativeArray<int> inOutIndices

The triangle indices of the mesh. This array is modified in place and will contain the new indices afterwards

NativeList<Vector3> outVertices

The new unique vertices of the welded mesh, this list should be cleared beforehand

NativeHashMap<int3, int> buckets

A temporary container used by the algorithm, this list should be cleared beforehand

NativeHashMap<int, int> shiftedIndices

A temporary container used by the algorithm

float weldThreshold

Distance below which two vertices will be welded together

Remarks

This method can be used inside a burst compiled job

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