C# Class Pathfinding.PointKDTree

Afficher le fichier Open project: FellowshipOfTheGame/anathema Class Usage Examples

Méthodes publiques

Méthode 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

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

Method Details

Add() public méthode

Add the node to the tree
public Add ( GraphNode node ) : void
node GraphNode
Résultat void

Add() public méthode

public Add ( GraphNode point, int index, int depth ) : void
point GraphNode
index int
depth int
Résultat void

Build() public méthode

public Build ( int index, List nodes, int start, int end ) : void
index int
nodes List
start int
end int
Résultat void

CollectAndClear() public méthode

public CollectAndClear ( int index, List buffer ) : void
index int
buffer List
Résultat void

EnsureSize() public méthode

public EnsureSize ( int index ) : void
index int
Résultat void

GetInRange() public méthode

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.
Résultat void

GetInRangeInternal() public méthode

public GetInRangeInternal ( int index, Int3 point, long sqrRadius, List buffer ) : void
index int
point Int3
sqrRadius long
buffer List
Résultat void

GetNearest() public méthode

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

GetNearestInternal() public méthode

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

PointKDTree() public méthode

public PointKDTree ( ) : System.Collections.Generic
Résultat System.Collections.Generic

Rebalance() public méthode

public Rebalance ( int index ) : void
index int
Résultat void

Rebuild() public méthode

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
Résultat void