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
TThe type stored in the octree.
- Inheritance
-
Octree<T>
- Inherited Members
Constructors
Octree(BoundingBox, int)
public Octree(BoundingBox boundingBox, int maxChildren)
Parameters
boundingBoxBoundingBoxmaxChildrenint
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
itemBoundsBoundingBoxitemT
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
resultsList<T>
GetAllContainedObjects(List<T>, Func<T, bool>)
public void GetAllContainedObjects(List<T> results, Func<T, bool> filter)
Parameters
GetContainedObjects(BoundingFrustum, List<T>)
public void GetContainedObjects(BoundingFrustum frustum, List<T> results)
Parameters
frustumBoundingFrustumresultsList<T>
GetContainedObjects(BoundingFrustum, List<T>, Func<T, bool>)
public void GetContainedObjects(BoundingFrustum frustum, List<T> results, Func<T, bool> filter)
Parameters
frustumBoundingFrustumresultsList<T>filterFunc<T, bool>
MoveItem(OctreeItem<T>, BoundingBox)
public void MoveItem(OctreeItem<T> octreeItem, BoundingBox newBounds)
Parameters
octreeItemOctreeItem<T>newBoundsBoundingBox
MoveItem(T, BoundingBox)
public void MoveItem(T item, BoundingBox newBounds)
Parameters
itemTnewBoundsBoundingBox
RayCast(Ray, List<RayCastHit<T>>, RayCastFilter<T>)
public int RayCast(Ray ray, List<RayCastHit<T>> hits, RayCastFilter<T> filter)
Parameters
rayRayhitsList<RayCastHit<T>>filterRayCastFilter<T>
Returns
RemoveItem(OctreeItem<T>)
public void RemoveItem(OctreeItem<T> octreeItem)
Parameters
octreeItemOctreeItem<T>
RemoveItem(T)
public bool RemoveItem(T item)
Parameters
itemT