C# Class Pathfinding.PointKDTree

Mostrar archivo Open project: FellowshipOfTheGame/anathema Class Usage Examples

Public Methods

Method Description
Add ( GraphNode node ) : void

Add the node to the tree

Add ( GraphNode point, int index, int depth ) : void
Build ( int index, List nodes, int start, int end ) : void
CollectAndClear ( int index, List buffer ) : void
EnsureSize ( int index ) : void
GetInRange ( Int3 point, long sqrRadius, List buffer ) : void

Add all nodes within a squared distance of the point to the buffer.

GetInRangeInternal ( int index, Int3 point, long sqrRadius, List buffer ) : void
GetNearest ( Int3 point, NNConstraint constraint ) : GraphNode

Closest node to the point which satisfies the constraint

GetNearestInternal ( int index, Int3 point, NNConstraint constraint, GraphNode &best, long &bestSqrDist ) : void
PointKDTree ( ) : System.Collections.Generic
Rebalance ( int index ) : void
Rebuild ( Array nodes, int start, int end ) : void

Rebuild the tree starting with all nodes in the array between index start (inclusive) and end (exclusive)

Private Methods

Method Description
GetOrCreateList ( ) : Pathfinding.GraphNode[]
MaxAllowedSize ( int numNodes, int depth ) : int
Size ( int index ) : int

Method Details

Add() public method

Add the node to the tree
public Add ( GraphNode node ) : void
node GraphNode
return void

Add() public method

public Add ( GraphNode point, int index, int depth ) : void
point GraphNode
index int
depth int
return void

Build() public method

public Build ( int index, List nodes, int start, int end ) : void
index int
nodes List
start int
end int
return void

CollectAndClear() public method

public CollectAndClear ( int index, List buffer ) : void
index int
buffer List
return void

EnsureSize() public method

public EnsureSize ( int index ) : void
index int
return void

GetInRange() public method

Add all nodes within a squared distance of the point to the buffer.
public GetInRange ( Int3 point, long sqrRadius, List buffer ) : void
point Int3 Nodes around this point will be added to the buffer.
sqrRadius long squared maximum distance in Int3 space. If you are converting from world space you will need to multiply by Int3.Precision: /// var sqrRadius = (worldSpaceRadius * Int3.Precision) * (worldSpaceRadius * Int3.Precision);
buffer List All nodes will be added to this list.
return void

GetInRangeInternal() public method

public GetInRangeInternal ( int index, Int3 point, long sqrRadius, List buffer ) : void
index int
point Int3
sqrRadius long
buffer List
return void

GetNearest() public method

Closest node to the point which satisfies the constraint
public GetNearest ( Int3 point, NNConstraint constraint ) : GraphNode
point Int3
constraint NNConstraint
return GraphNode

GetNearestInternal() public method

public GetNearestInternal ( int index, Int3 point, NNConstraint constraint, GraphNode &best, long &bestSqrDist ) : void
index int
point Int3
constraint NNConstraint
best GraphNode
bestSqrDist long
return void

PointKDTree() public method

public PointKDTree ( ) : System.Collections.Generic
return System.Collections.Generic

Rebalance() public method

public Rebalance ( int index ) : void
index int
return void

Rebuild() public method

Rebuild the tree starting with all nodes in the array between index start (inclusive) and end (exclusive)
public Rebuild ( Array nodes, int start, int end ) : void
nodes Array
start int
end int
return void