Show / Hide Table of Contents

Class MyDynamicAABBTreeD

Dynamic aabb tree implementation as a prunning structure

Inheritance
System.Object
MyDynamicAABBTreeD
Namespace: VRageMath
Assembly: VRage.Math.dll
Syntax
public class MyDynamicAABBTreeD : Object

Constructors

MyDynamicAABBTreeD()

Declaration
public MyDynamicAABBTreeD()

MyDynamicAABBTreeD(Vector3D, Double)

Declaration
public MyDynamicAABBTreeD(Vector3D extension, double aabbMultiplier = 1)
Parameters
Type Name Description
Vector3D extension
System.Double aabbMultiplier

Fields

NullNode

A dynamic tree arranges data in a binary tree to accelerate queries such as volume queries and ray casts. Leafs are proxies with an BoundingBox. In the tree we expand the proxy BoundingBox by Settings.b2_fatAABBFactor so that the proxy BoundingBox is bigger than the client object. This allows the client object to move by small amounts without triggering a tree update. Nodes are pooled and relocatable, so we use node indices rather than pointers.

Declaration
public const int NullNode = -1
Field Value
Type Description
System.Int32

Properties

ElementsCount

Declaration
public int ElementsCount { get; }
Property Value
Type Description
System.Int32

Methods

AddProxy(ref BoundingBoxD, Object, UInt32, Boolean)

Create a proxy. Provide a tight fitting BoundingBox and a userData pointer.

Declaration
public int AddProxy(ref BoundingBoxD aabb, object userData, uint userFlags, bool rebalance = true)
Parameters
Type Name Description
BoundingBoxD aabb

The aabb.

System.Object userData

The user data.

System.UInt32 userFlags
System.Boolean rebalance
Returns
Type Description
System.Int32

Balance(Int32)

Declaration
public int Balance(int iA)
Parameters
Type Name Description
System.Int32 iA
Returns
Type Description
System.Int32

Clear()

Declaration
public void Clear()

CountLeaves(Int32)

Declaration
public int CountLeaves(int nodeId)
Parameters
Type Name Description
System.Int32 nodeId
Returns
Type Description
System.Int32

Dispose()

Declaration
public static void Dispose()

GetAabb(Int32)

Declaration
public BoundingBoxD GetAabb(int proxyId)
Parameters
Type Name Description
System.Int32 proxyId
Returns
Type Description
BoundingBoxD

GetAll<T>(Action<T, BoundingBoxD>)

Declaration
public void GetAll<T>(Action<T, BoundingBoxD> add)
Parameters
Type Name Description
System.Action<T, BoundingBoxD> add
Type Parameters
Name Description
T

GetAll<T>(Action<T>)

Declaration
public void GetAll<T>(Action<T> add)
Parameters
Type Name Description
System.Action<T> add
Type Parameters
Name Description
T

GetAll<T>(List<T>, Boolean, List<BoundingBoxD>)

Declaration
public void GetAll<T>(List<T> elementsList, bool clear, List<BoundingBoxD> boxsList = null)
Parameters
Type Name Description
System.Collections.Generic.List<T> elementsList
System.Boolean clear
System.Collections.Generic.List<BoundingBoxD> boxsList
Type Parameters
Name Description
T

GetAllNodeBounds(List<BoundingBoxD>)

Declaration
public void GetAllNodeBounds(List<BoundingBoxD> boxsList)
Parameters
Type Name Description
System.Collections.Generic.List<BoundingBoxD> boxsList

GetAproximateClustersForAabb(ref BoundingBoxD, Double, List<BoundingBoxD>)

Declaration
public void GetAproximateClustersForAabb(ref BoundingBoxD bbox, double minSize, List<BoundingBoxD> boundList)
Parameters
Type Name Description
BoundingBoxD bbox
System.Double minSize
System.Collections.Generic.List<BoundingBoxD> boundList

GetAproximateClustersForAabbDebug(ref BoundingBoxD, Double, List<BoundingBoxD>, List<MyTuple<Boolean, Int32, Object>>)

Declaration
public void GetAproximateClustersForAabbDebug(ref BoundingBoxD bbox, double minSize, List<BoundingBoxD> boundList, List<MyTuple<bool, int, object>> nodeList)
Parameters
Type Name Description
BoundingBoxD bbox
System.Double minSize
System.Collections.Generic.List<BoundingBoxD> boundList
System.Collections.Generic.List<VRage.MyTuple<System.Boolean, System.Int32, System.Object>> nodeList

GetChildren(Int32, out Int32, out Int32)

Declaration
public void GetChildren(int proxyId, out int left, out int right)
Parameters
Type Name Description
System.Int32 proxyId
System.Int32 left
System.Int32 right

GetFatAABB(Int32, out BoundingBoxD)

Get the fat BoundingBox for a proxy.

Declaration
public void GetFatAABB(int proxyId, out BoundingBoxD fatAABB)
Parameters
Type Name Description
System.Int32 proxyId

The proxy id.

BoundingBoxD fatAABB

The fat BoundingBox.

GetHeight()

Declaration
public int GetHeight()
Returns
Type Description
System.Int32

GetLeafCount(Int32)

Declaration
public int GetLeafCount(int proxyId)
Parameters
Type Name Description
System.Int32 proxyId
Returns
Type Description
System.Int32

GetNodeLeaves(Int32, List<Int32>)

Declaration
public void GetNodeLeaves(int proxyId, List<int> children)
Parameters
Type Name Description
System.Int32 proxyId
System.Collections.Generic.List<System.Int32> children

GetRoot()

Declaration
public int GetRoot()
Returns
Type Description
System.Int32

GetUserData<T>(Int32)

Get proxy user data.

Declaration
public T GetUserData<T>(int proxyId)
Parameters
Type Name Description
System.Int32 proxyId

The proxy id.

Returns
Type Description
T

the proxy user data or 0 if the id is invalid.

Type Parameters
Name Description
T

IsRootNull()

Declaration
public bool IsRootNull()
Returns
Type Description
System.Boolean

MoveProxy(Int32, ref BoundingBoxD, Vector3D)

Move a proxy with a swepted BoundingBox. If the proxy has moved outside of its fattened BoundingBox, then the proxy is removed from the tree and re-inserted. Otherwise the function returns immediately.

Declaration
public bool MoveProxy(int proxyId, ref BoundingBoxD aabb, Vector3D displacement)
Parameters
Type Name Description
System.Int32 proxyId

The proxy id.

BoundingBoxD aabb

The aabb.

Vector3D displacement

Predicted (expected) movement

Returns
Type Description
System.Boolean

true if the proxy was re-inserted.

OverlapAllBoundingBox<T>(ref BoundingBoxD, List<T>, UInt32, Boolean)

Declaration
public void OverlapAllBoundingBox<T>(ref BoundingBoxD bbox, List<T> elementsList, uint requiredFlags = 0U, bool clear = true)
Parameters
Type Name Description
BoundingBoxD bbox
System.Collections.Generic.List<T> elementsList
System.UInt32 requiredFlags
System.Boolean clear
Type Parameters
Name Description
T

OverlapAllBoundingBox<T>(ref MyOrientedBoundingBoxD, List<T>, UInt32, Boolean)

Declaration
public void OverlapAllBoundingBox<T>(ref MyOrientedBoundingBoxD obb, List<T> elementsList, uint requiredFlags = 0U, bool clear = true)
Parameters
Type Name Description
MyOrientedBoundingBoxD obb
System.Collections.Generic.List<T> elementsList
System.UInt32 requiredFlags
System.Boolean clear
Type Parameters
Name Description
T

OverlapAllBoundingSphere<T>(ref BoundingSphereD, Action<T>)

Declaration
public void OverlapAllBoundingSphere<T>(ref BoundingSphereD sphere, Action<T> addAction)
Parameters
Type Name Description
BoundingSphereD sphere
System.Action<T> addAction
Type Parameters
Name Description
T

OverlapAllBoundingSphere<T>(ref BoundingSphereD, List<T>, Boolean)

Declaration
public void OverlapAllBoundingSphere<T>(ref BoundingSphereD sphere, List<T> overlapElementsList, bool clear = true)
Parameters
Type Name Description
BoundingSphereD sphere
System.Collections.Generic.List<T> overlapElementsList
System.Boolean clear
Type Parameters
Name Description
T

OverlapAllFrustum<T>(ref BoundingFrustumD, T)

Declaration
public void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, T results)
Parameters
Type Name Description
BoundingFrustumD frustum
T results
Type Parameters
Name Description
T

OverlapAllFrustum<T>(ref BoundingFrustumD, T, Single)

Declaration
public void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, T results, float tSqr)
Parameters
Type Name Description
BoundingFrustumD frustum
T results
System.Single tSqr
Type Parameters
Name Description
T

OverlapAllFrustum<T>(ref BoundingFrustumD, Action<T, Boolean>, Single)

Declaration
public void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, Action<T, bool> add, float tSqr)
Parameters
Type Name Description
BoundingFrustumD frustum
System.Action<T, System.Boolean> add
System.Single tSqr
Type Parameters
Name Description
T

OverlapAllFrustum<T>(ref BoundingFrustumD, List<T>, Boolean)

Declaration
public void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, List<T> elementsList, bool clear = true)
Parameters
Type Name Description
BoundingFrustumD frustum
System.Collections.Generic.List<T> elementsList
System.Boolean clear
Type Parameters
Name Description
T

OverlapAllFrustum<T>(ref BoundingFrustumD, List<T>, List<Boolean>)

Declaration
public void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, List<T> elementsList, List<bool> isInsideList)
Parameters
Type Name Description
BoundingFrustumD frustum
System.Collections.Generic.List<T> elementsList
System.Collections.Generic.List<System.Boolean> isInsideList
Type Parameters
Name Description
T

OverlapAllFrustum<T>(ref BoundingFrustumD, List<T>, List<Boolean>, Single, Boolean)

Declaration
public void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, List<T> elementsList, List<bool> isInsideList, float tSqr, bool clear = true)
Parameters
Type Name Description
BoundingFrustumD frustum
System.Collections.Generic.List<T> elementsList
System.Collections.Generic.List<System.Boolean> isInsideList
System.Single tSqr
System.Boolean clear
Type Parameters
Name Description
T

OverlapAllFrustum<T>(ref BoundingFrustumD, List<T>, UInt32, Boolean)

Declaration
public void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, List<T> elementsList, uint requiredFlags, bool clear = true)
Parameters
Type Name Description
BoundingFrustumD frustum
System.Collections.Generic.List<T> elementsList
System.UInt32 requiredFlags
System.Boolean clear
Type Parameters
Name Description
T

OverlapAllFrustumAny<T>(ref BoundingFrustumD, List<T>, Boolean)

Declaration
public void OverlapAllFrustumAny<T>(ref BoundingFrustumD frustum, List<T> elementsList, bool clear = true)
Parameters
Type Name Description
BoundingFrustumD frustum
System.Collections.Generic.List<T> elementsList
System.Boolean clear
Type Parameters
Name Description
T

OverlapAllLineSegment<T>(ref LineD, List<MyLineSegmentOverlapResult<T>>, Boolean)

Declaration
public void OverlapAllLineSegment<T>(ref LineD line, List<MyLineSegmentOverlapResult<T>> elementsList, bool clear = true)
Parameters
Type Name Description
LineD line
System.Collections.Generic.List<MyLineSegmentOverlapResult<T>> elementsList
System.Boolean clear
Type Parameters
Name Description
T

OverlapAllLineSegment<T>(ref LineD, List<MyLineSegmentOverlapResult<T>>, UInt32, Boolean)

Declaration
public void OverlapAllLineSegment<T>(ref LineD line, List<MyLineSegmentOverlapResult<T>> elementsList, uint requiredFlags, bool clear = true)
Parameters
Type Name Description
LineD line
System.Collections.Generic.List<MyLineSegmentOverlapResult<T>> elementsList
System.UInt32 requiredFlags
System.Boolean clear
Type Parameters
Name Description
T

OverlapsAnyLeafBoundingBox(ref BoundingBoxD)

Declaration
public bool OverlapsAnyLeafBoundingBox(ref BoundingBoxD bbox)
Parameters
Type Name Description
BoundingBoxD bbox
Returns
Type Description
System.Boolean

Query(Func<Int32, Boolean>, ref BoundingBoxD)

Declaration
public void Query(Func<int, bool> callback, ref BoundingBoxD aabb)
Parameters
Type Name Description
System.Func<System.Int32, System.Boolean> callback
BoundingBoxD aabb

QueryPoint(Func<Int32, Boolean>, ref Vector3D)

Declaration
public void QueryPoint(Func<int, bool> callback, ref Vector3D point)
Parameters
Type Name Description
System.Func<System.Int32, System.Boolean> callback
Vector3D point

RemoveProxy(Int32)

Destroy a proxy. This asserts if the id is invalid.

Declaration
public void RemoveProxy(int proxyId)
Parameters
Type Name Description
System.Int32 proxyId

The proxy id.

☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾