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

VRageMath.MyDynamicAABBTreeD

Morten Aune Lyrstad edited this page Sep 2, 2023 · 53 revisions

IndexNamespace Index

MyDynamicAABBTreeD Class

public class MyDynamicAABBTreeD

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

int ElementsCount { get; }

Constructors

MyDynamicAABBTreeD()

MyDynamicAABBTreeD(Vector3D extension, double aabbMultiplier = 1)

Methods

static void Dispose()

int AddProxy(ref BoundingBoxD 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)

BoundingBoxD GetAabb(int proxyId)

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

void GetAll<T>(Action<T> add)

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

void GetAllNodeBounds(List<BoundingBoxD> boxsList)

void GetAproximateClustersForAabb(ref BoundingBoxD bbox, double minSize, List<BoundingBoxD> boundList)

void GetAproximateClustersForAabbDebug(ref BoundingBoxD bbox, double minSize, List<BoundingBoxD> boundList, List<MyTuple<bool, int, object>> nodeList)

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

void GetFatAABB(int proxyId, out BoundingBoxD fatAABB)

Get the fat BoundingBox for a proxy.

int GetHeight()

int GetLeafCount(int proxyId)

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

int GetRoot()

T GetUserData<T>(int proxyId)

bool IsRootNull()

bool MoveProxy(int proxyId, ref BoundingBoxD aabb, Vector3D 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 BoundingBoxD bbox, List<T> elementsList, uint requiredFlags = 0, bool clear = default)

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

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

void OverlapAllBoundingSphere<T>(ref BoundingSphereD sphere, Action<T> addAction)

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

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

void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, List<T> elementsList, List<bool> isInsideList)

void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, T results)

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

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

void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, T results, float tSqr)

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

void OverlapAllLineSegment<T>(ref LineD line, List<MyLineSegmentOverlapResult<T>> elementsList, bool clear = default)

void OverlapAllLineSegment<T>(ref LineD line, List<MyLineSegmentOverlapResult<T>> elementsList, uint requiredFlags, bool clear = default)

bool OverlapsAnyLeafBoundingBox(ref BoundingBoxD bbox)

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

void QueryPoint(Func<int, bool> callback, ref Vector3D point)

void RemoveProxy(int proxyId)

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

Clone this wiki locally