Class KDTree<T>
java.lang.Object
com.hypixel.hytale.component.spatial.KDTree<T>
- All Implemented Interfaces:
SpatialStructure<T>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final List<KDTree.Node<T>> private intprivate KDTree.Node<T> private int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void_internal_ordered3DAxis(List<KDTree.OrderedEntry<T>> results, KDTree.Node<T> node, Vector3d center, double xSearchRadius, double ySearchRadius, double zSearchRadius, int depth) private voidbuild0(SpatialData<T> spatialData, int start, int end) private voidclosest0(KDTree.ClosestState<T> closestState, KDTree.Node<T> node, Vector3d vector, int depth) voidprivate voidvoidcollectBox(Vector3d min, Vector3d max, List<T> results) private voidcollectBox0(List<T> results, KDTree.Node<T> node, Vector3d min, Vector3d max, int depth) voidcollectCylinder(Vector3d center, double radius, double height, List<T> results) private voidcollectCylinder0(List<T> results, KDTree.Node<T> node, Vector3d center, double radiusSq, double halfHeight, double radius, int depth) private static intdump()private static doubleprivate KDTree.Node<T> getPooledNode(Vector3d vector, List<T> data) voidprivate voidordered0(List<KDTree.OrderedEntry<T>> results, KDTree.Node<T> node, Vector3d vector, double distanceSq, int depth) voidordered3DAxis(Vector3d center, double xSearchRadius, double YSearchRadius, double zSearchRadius, List<T> results) private voidvoidrebuild(SpatialData<T> spatialData) intsize()
-
Field Details
-
nodePool
-
nodePoolIndex
private int nodePoolIndex -
dataListPool
-
dataListPoolIndex
private int dataListPoolIndex -
size
private int size -
collectionFilter
-
root
-
-
Constructor Details
-
KDTree
-
-
Method Details
-
size
public int size()- Specified by:
sizein interfaceSpatialStructure<T>
-
rebuild
- Specified by:
rebuildin interfaceSpatialStructure<T>
-
closest
- Specified by:
closestin interfaceSpatialStructure<T>
-
collect
- Specified by:
collectin interfaceSpatialStructure<T>
-
collectCylinder
public void collectCylinder(@Nonnull Vector3d center, double radius, double height, @Nonnull List<T> results) - Specified by:
collectCylinderin interfaceSpatialStructure<T>
-
collectBox
- Specified by:
collectBoxin interfaceSpatialStructure<T>
-
ordered
- Specified by:
orderedin interfaceSpatialStructure<T>
-
ordered3DAxis
public void ordered3DAxis(@Nonnull Vector3d center, double xSearchRadius, double YSearchRadius, double zSearchRadius, @Nonnull List<T> results) - Specified by:
ordered3DAxisin interfaceSpatialStructure<T>
-
dump
- Specified by:
dumpin interfaceSpatialStructure<T>
-
getPooledNode
-
getPooledDataList
-
build0
-
put0
private void put0(@Nonnull KDTree.Node<T> node, @Nonnull Vector3d vector, @Nonnull List<T> list, int axis) -
closest0
private void closest0(@Nonnull KDTree.ClosestState<T> closestState, @Nullable KDTree.Node<T> node, @Nonnull Vector3d vector, int depth) -
collect0
private void collect0(@Nonnull List<T> results, @Nullable KDTree.Node<T> node, @Nonnull Vector3d vector, double distanceSq, int depth) -
collectCylinder0
private void collectCylinder0(@Nonnull List<T> results, @Nullable KDTree.Node<T> node, @Nonnull Vector3d center, double radiusSq, double halfHeight, double radius, int depth) -
collectBox0
-
ordered0
private void ordered0(@Nonnull List<KDTree.OrderedEntry<T>> results, @Nullable KDTree.Node<T> node, @Nonnull Vector3d vector, double distanceSq, int depth) -
_internal_ordered3DAxis
private void _internal_ordered3DAxis(@Nonnull List<KDTree.OrderedEntry<T>> results, @Nullable KDTree.Node<T> node, @Nonnull Vector3d center, double xSearchRadius, double ySearchRadius, double zSearchRadius, int depth) -
compare
-
get
-