Class STreeUtilities

Namespace
Elegy.Common.SpatialCollections
Assembly
Elegy.Common.dll

Built-in helper methods for STree<TBound, TItem>.

public static class STreeUtilities
Inheritance
STreeUtilities
Inherited Members

Fields

OctreeMinMaxIndices

Look at GetChildVolumeOctree<TItem>() to see the usage of this.

public static readonly int[] OctreeMinMaxIndices

Field Value

int[]

QuadtreeMinMaxIndices

Look at GetChildVolumeQuadtree<TItem>() to see the usage of this.

public static readonly int[] QuadtreeMinMaxIndices

Field Value

int[]

Methods

CollectIntersectionsAll<TBound, TItem>(IsInBoundFn)

Accumulates all intersections into a node's children. Meaning if your item intersects all children, all children get that item.

public static STree<TBound, TItem>.CollectIntersectionsFn CollectIntersectionsAll<TBound, TItem>(STree<TBound, TItem>.IsInBoundFn intersectionMethod) where TBound : struct

Parameters

intersectionMethod STree<TBound, TItem>.IsInBoundFn

Returns

STree<TBound, TItem>.CollectIntersectionsFn

Type Parameters

TBound
TItem

CollectIntersectionsFirst<TBound, TItem>(IsInBoundFn)

Only takes in the first intersection.

public static STree<TBound, TItem>.CollectIntersectionsFn CollectIntersectionsFirst<TBound, TItem>(STree<TBound, TItem>.IsInBoundFn intersectionMethod) where TBound : struct

Parameters

intersectionMethod STree<TBound, TItem>.IsInBoundFn

Returns

STree<TBound, TItem>.CollectIntersectionsFn

Type Parameters

TBound
TItem

GetChildVolumeOctree<TItem>()

Subdivides an AABB into 8 equal octants. Restriction: dimensionality must be 3.

public static STree<Box3, TItem>.GetChildVolumeFn GetChildVolumeOctree<TItem>()

Returns

STree<Box3, TItem>.GetChildVolumeFn

Type Parameters

TItem

GetChildVolumeQuadtree<TItem>()

Subdivides a rectangle into 4 equal quadrants. Restriction: dimensionality must be 2.

public static STree<Rect2, TItem>.GetChildVolumeFn GetChildVolumeQuadtree<TItem>()

Returns

STree<Rect2, TItem>.GetChildVolumeFn

Type Parameters

TItem

IsInBoundVector2()

TBound: Rect2 TItem: Vector2

public static STree<Rect2, Vector2>.IsInBoundFn IsInBoundVector2()

Returns

STree<Rect2, Vector2>.IsInBoundFn

IsInBoundVector3()

TBound: Box3 TItem: Vector3

public static STree<Box3, Vector3>.IsInBoundFn IsInBoundVector3()

Returns

STree<Box3, Vector3>.IsInBoundFn

IsInBoundVector4()

TBound: Box3 TItem: Vector4

public static STree<Box3, Vector4>.IsInBoundFn IsInBoundVector4()

Returns

STree<Box3, Vector4>.IsInBoundFn

ShouldSubdivideThreshold<TBound, TItem>(int)

Very simple threshold-based subdivision function. If a node has more than threshold elements, it'll subdivide. If not, it'll become a leaf.

public static STree<TBound, TItem>.ShouldSubdivideFn ShouldSubdivideThreshold<TBound, TItem>(int threshold) where TBound : struct

Parameters

threshold int

Returns

STree<TBound, TItem>.ShouldSubdivideFn

Type Parameters

TBound
TItem