Click or drag to resize
DigitalRuneAabbTree<T> Class
Represents a bounding volume tree using axis-aligned bounding boxes (AABBs).
Inheritance Hierarchy
System.Object
  DigitalRune.Geometry.Partitioning.BasePartition<T>
    DigitalRune.Geometry.Partitioning.AabbTree<T>

Namespace: DigitalRune.Geometry.Partitioning
Assembly: DigitalRune.Geometry (in DigitalRune.Geometry.dll) Version: 1.18.0.0 (1.18.2.14427)
Syntax
public class AabbTree<T> : BasePartition<T>, 
	ISupportClosestPointQueries<T>

Type Parameters

T
The type of item in the spatial partition.

The AabbTree< T> type exposes the following members.

Constructors
  NameDescription
Public methodAabbTree<T>
Initializes a new instance of the AabbTree< T> class
Top
Methods
  NameDescription
Public methodAdd (Inherited from BasePartition<T>.)
Public methodClear (Inherited from BasePartition<T>.)
Public methodClone (Inherited from BasePartition<T>.)
Protected methodCloneCore (Overrides BasePartition<T>.CloneCore(BasePartition<T>).)
Public methodContains (Inherited from BasePartition<T>.)
Public methodCopyTo (Inherited from BasePartition<T>.)
Protected methodCreateInstanceCore (Overrides BasePartition<T>.CreateInstanceCore().)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetClosestPointCandidates(Aabb, Single, Func<T, Single>)
Gets all items that are candidates for the smallest closest-point distance to a given axis-aligned bounding box (AABB).
Public methodGetClosestPointCandidates(Vector3F, Pose, ISpatialPartition<T>, Vector3F, Pose, Func<T, T, Single>)
Gets all items that are candidates for the smallest closest-point distance to items in a given partition.
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
(Inherited from BasePartition<T>.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetOverlaps()
Gets overlaps of all items contained in this spatial partition.
(Inherited from BasePartition<T>.)
Public methodGetOverlaps(Aabb)
Gets the items that touch the given axis-aligned bounding box (AABB).
(Overrides BasePartition<T>.GetOverlaps(Aabb).)
Public methodGetOverlaps(Aabb)
Gets the items that touch the given axis-aligned bounding box (AABB).
(Inherited from BasePartition<T>.)
Public methodGetOverlaps(ISpatialPartition<T>)
Gets overlaps between all items of this spatial partition and the items of another spatial partition.
(Overrides BasePartition<T>.GetOverlaps(ISpatialPartition<T>).)
Public methodGetOverlaps(Ray)
Gets the items that touch the given ray.
(Overrides BasePartition<T>.GetOverlaps(Ray).)
Public methodGetOverlaps(Vector3F, Pose, ISpatialPartition<T>, Vector3F, Pose)
Gets overlaps between all items of this spatial partition and the items of another spatial partition.
(Overrides BasePartition<T>.GetOverlaps(Vector3F, Pose, ISpatialPartition<T>, Vector3F, Pose).)
Public methodGetOverlaps(Vector3F, Pose, AabbTree<T>, Vector3F, Pose, List<Pair<T>>)
Gets overlaps between all items of this spatial partition and the items of another spatial partition.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInvalidate()
Invalidates the cached spatial information of all items in the spatial partition.
(Inherited from BasePartition<T>.)
Public methodInvalidate(T)
Invalidates the cached spatial information of the specified item.
(Inherited from BasePartition<T>.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemove (Inherited from BasePartition<T>.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate (Inherited from BasePartition<T>.)
Top
Properties
  NameDescription
Public propertyAabb
Gets the axis-aligned bounding box (AABB) that contains all items.
(Inherited from BasePartition<T>.)
Public propertyBottomUpBuildThreshold
Gets or sets the threshold that determines when a bottom-up tree build method is used.
Public propertyCount (Inherited from BasePartition<T>.)
Public propertyEnableSelfOverlaps
Gets or sets a value indicating whether self-overlaps are computed.
(Inherited from BasePartition<T>.)
Public propertyFilter
Gets or sets the filter that is used to filter overlaps of two items.
(Inherited from BasePartition<T>.)
Public propertyGetAabbForItem
Gets or sets the method that computes the Aabb of an item.
(Inherited from BasePartition<T>.)
Top
Explicit Interface Implementations
  NameDescription
Explicit interface implementationPrivate methodIEnumerable<T>.GetEnumerator
Returns an enumerator that iterates through the collection.
(Inherited from BasePartition<T>.)
Explicit interface implementationPrivate methodIEnumerable.GetEnumerator
Returns an enumerator that iterates through a collection.
(Inherited from BasePartition<T>.)
Explicit interface implementationPrivate propertyICollection<T>.IsReadOnly (Inherited from BasePartition<T>.)
Explicit interface implementationPrivate methodISpatialPartition<T>.Clone
Creates a new spatial partition that is a clone (deep copy) of the current instance.
(Inherited from BasePartition<T>.)
Top
Remarks

AabbTree< T> partitions are good for partitioning static models or spaces where items are not changed at runtime or when the changes are small or local. For example, an AabbTree< T> is appropriate for managing large static triangle meshes efficiently. But they are not suitable for dynamic models or spaces where items are added/removed at runtime or when the large changes are applied to items.

Consider using the CompressedAabbTree instead of the AabbTree< T> if items of type Int32 need to be stored. The CompressedAabbTree reduced the memory requirements considerably.

Special handling of self-overlaps in GetOverlaps(ISpatialPartition<T>): If GetOverlaps(ISpatialPartition< T> ) is used to test an AABB tree against itself then overlaps of an item with itself are not returned; that means, each item A overlaps with itself but (A, A) is not returned. And if two different items overlap, only one overlap is returned, for example: If item A and item B overlap (A, B) or (B, A) is returned but not both.

See Also