Table of Contents

Class Octree<T>

Namespace
NeoVeldrid.Utilities
Assembly
NeoVeldrid.Utilities.dll

Maintains a reference to the current root node of a dynamic octree. The root node may change as items are added and removed from contained nodes.

public class Octree<T>

Type Parameters

T

The type stored in the octree.

Inheritance
Octree<T>
Inherited Members

Constructors

Octree(BoundingBox, int)

public Octree(BoundingBox boundingBox, int maxChildren)

Parameters

boundingBox BoundingBox
maxChildren int

Properties

CurrentRoot

The current root node of the octree. This may change when items are added and removed.

public OctreeNode<T> CurrentRoot { get; }

Property Value

OctreeNode<T>

Methods

AddItem(BoundingBox, T)

public OctreeItem<T> AddItem(BoundingBox itemBounds, T item)

Parameters

itemBounds BoundingBox
item T

Returns

OctreeItem<T>

ApplyPendingMoves()

Apply pending moves. This may change the current root node.

public void ApplyPendingMoves()

Clear()

public void Clear()

GetAllContainedObjects(List<T>)

public void GetAllContainedObjects(List<T> results)

Parameters

results List<T>

GetAllContainedObjects(List<T>, Func<T, bool>)

public void GetAllContainedObjects(List<T> results, Func<T, bool> filter)

Parameters

results List<T>
filter Func<T, bool>

GetContainedObjects(BoundingFrustum, List<T>)

public void GetContainedObjects(BoundingFrustum frustum, List<T> results)

Parameters

frustum BoundingFrustum
results List<T>

GetContainedObjects(BoundingFrustum, List<T>, Func<T, bool>)

public void GetContainedObjects(BoundingFrustum frustum, List<T> results, Func<T, bool> filter)

Parameters

frustum BoundingFrustum
results List<T>
filter Func<T, bool>

MoveItem(OctreeItem<T>, BoundingBox)

public void MoveItem(OctreeItem<T> octreeItem, BoundingBox newBounds)

Parameters

octreeItem OctreeItem<T>
newBounds BoundingBox

MoveItem(T, BoundingBox)

public void MoveItem(T item, BoundingBox newBounds)

Parameters

item T
newBounds BoundingBox

RayCast(Ray, List<RayCastHit<T>>, RayCastFilter<T>)

public int RayCast(Ray ray, List<RayCastHit<T>> hits, RayCastFilter<T> filter)

Parameters

ray Ray
hits List<RayCastHit<T>>
filter RayCastFilter<T>

Returns

int

RemoveItem(OctreeItem<T>)

public void RemoveItem(OctreeItem<T> octreeItem)

Parameters

octreeItem OctreeItem<T>

RemoveItem(T)

public bool RemoveItem(T item)

Parameters

item T

Returns

bool