Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

VRageMath.MyDynamicAABBTree

Morten Aune Lyrstad edited this page Apr 16, 2022 · 53 revisions

IndexNamespace Index

MyDynamicAABBTree Class

public class MyDynamicAABBTree

Dynamic aabb tree implementation as a prunning structure

Namespace: VRageMath
Assembly: VRage.Math.dll

Fields

static int 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.

Properties

DictionaryValuesReader<int, DynamicTreeNode> Leaves { get; }

ReadOnlySpan<DynamicTreeNode> Nodes { get; }

Constructors

MyDynamicAABBTree()

MyDynamicAABBTree(Vector3 extension, float aabbMultiplier = 1)

Methods

static void Dispose()

int AddProxy(ref BoundingBox aabb, object userData, uint userFlags, bool rebalance = default)

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

int Balance(int iA)

void Clear()

int CountLeaves(int nodeId)

BoundingBox GetAabb(int proxyId)

void GetAll<T>(List<T> elementsList, bool clear, List<BoundingBox> boxsList = null)

void GetAllNodeBounds(List<BoundingBox> boxsList)

void GetChildren(int proxyId, out int left, out int right)

void GetFatAABB(int proxyId, out BoundingBox fatAABB)

Get the fat BoundingBox for a proxy.

int GetHeight()

int GetLeafCount()

int GetLeafCount(int proxyId)

void GetNodeLeaves(int proxyId, List<int> children)

int GetRoot()

T GetUserData<T>(int proxyId)

bool MoveProxy(int proxyId, ref BoundingBox aabb, Vector3 displacement)

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.

void OverlapAllBoundingBox<T>(ref BoundingBox bbox, List<T> elementsList, uint requiredFlags = 0, bool clear = default)

void OverlapAllBoundingSphere<T>(ref BoundingSphere sphere, List<T> overlapElementsList, bool clear = default)

void OverlapAllFrustum<T>(ref BoundingFrustum frustum, List<T> elementsList, bool clear = default)

void OverlapAllFrustum<T>(ref BoundingFrustum frustum, List<T> elementsList, uint requiredFlags, bool clear = default)

void OverlapAllFrustum<T>(ref BoundingFrustum frustum, List<T> elementsList, List<bool> isInsideList, bool clear = default)

void OverlapAllFrustum<T>(ref BoundingFrustum frustum, Action<T, bool> add)

void OverlapAllFrustum<T, Op>(ref BoundingFrustum frustum, ref Op add)

void OverlapAllFrustum<T>(ref BoundingFrustum frustum, List<T> elementsList, List<bool> isInsideList, float tSqr, bool clear = default)

void OverlapAllFrustum<T>(ref BoundingFrustum frustum, Action<T, bool> add, float tSqr)

void OverlapAllFrustum<T, Op>(ref BoundingFrustum frustum, float tSqr, ref Op add)

void OverlapAllFrustumAny<T>(ref BoundingFrustum frustum, List<T> elementsList, bool clear = default)

void OverlapAllFrustumConservative<T>(ref BoundingFrustum frustum, List<T> elementsList, uint requiredFlags, bool clear = default)

void OverlapAllLineSegment<T>(ref Line line, List<MyLineSegmentOverlapResult<T>> elementsList)

void OverlapAllLineSegment<T>(ref Line line, List<MyLineSegmentOverlapResult<T>> elementsList, uint requiredFlags)

bool OverlapsAnyLeafBoundingBox(ref BoundingBox bbox)

void OverlapSizeableClusters(ref BoundingBox bbox, List<BoundingBox> boundList, double minSize)

void Query(Func<int, bool> callback, ref BoundingBox aabb)

void RemoveProxy(int proxyId)

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

Clone this wiki locally