C# Класс Pathfinding.PointKDTree

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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)

Приватные методы

Метод Описание
GetOrCreateList ( ) : Pathfinding.GraphNode[]
MaxAllowedSize ( int numNodes, int depth ) : int
Size ( int index ) : int

Описание методов

Add() публичный Метод

Add the node to the tree
public Add ( GraphNode node ) : void
node GraphNode
Результат void

Add() публичный Метод

public Add ( GraphNode point, int index, int depth ) : void
point GraphNode
index int
depth int
Результат void

Build() публичный Метод

public Build ( int index, List nodes, int start, int end ) : void
index int
nodes List
start int
end int
Результат void

CollectAndClear() публичный Метод

public CollectAndClear ( int index, List buffer ) : void
index int
buffer List
Результат void

EnsureSize() публичный Метод

public EnsureSize ( int index ) : void
index int
Результат void

GetInRange() публичный Метод

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.
Результат void

GetInRangeInternal() публичный Метод

public GetInRangeInternal ( int index, Int3 point, long sqrRadius, List buffer ) : void
index int
point Int3
sqrRadius long
buffer List
Результат void

GetNearest() публичный Метод

Closest node to the point which satisfies the constraint
public GetNearest ( Int3 point, NNConstraint constraint ) : GraphNode
point Int3
constraint NNConstraint
Результат GraphNode

GetNearestInternal() публичный Метод

public GetNearestInternal ( int index, Int3 point, NNConstraint constraint, GraphNode &best, long &bestSqrDist ) : void
index int
point Int3
constraint NNConstraint
best GraphNode
bestSqrDist long
Результат void

PointKDTree() публичный Метод

public PointKDTree ( ) : System.Collections.Generic
Результат System.Collections.Generic

Rebalance() публичный Метод

public Rebalance ( int index ) : void
index int
Результат void

Rebuild() публичный Метод

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
Результат void