-
Notifications
You must be signed in to change notification settings - Fork 124
VRageMath.MyDynamicAABBTreeD
← Index ← Namespace Index
public class MyDynamicAABBTreeD
Dynamic aabb tree implementation as a prunning structure
Namespace: VRageMath
Assembly: VRage.Math.dll
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.
MyDynamicAABBTreeD(Vector3D extension, double aabbMultiplier = 1)
int AddProxy(ref BoundingBoxD aabb, object userData, uint userFlags, bool rebalance = default)
Create a proxy. Provide a tight fitting BoundingBox and a userData pointer.
BoundingBoxD GetAabb(int proxyId)
void GetAll<T>(List<T> elementsList, bool clear, List<BoundingBoxD> boxsList = null)
void GetAll<T>(Action<T, BoundingBoxD> add)
void GetAllNodeBounds(List<BoundingBoxD> boxsList)
void GetChildren(int proxyId, out int left, out int right)
void GetFatAABB(int proxyId, out BoundingBoxD fatAABB)
Get the fat BoundingBox for a proxy.
void GetNodeLeaves(int proxyId, List<int> children)
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 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, T results)
void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, Action<T, bool> add, float tSqr)
void OverlapAllFrustum<T>(ref BoundingFrustumD frustum, T results, float tSqr)
bool OverlapsAnyLeafBoundingBox(ref BoundingBoxD bbox)
void Query(Func<int, bool> callback, ref BoundingBoxD aabb)
void QueryPoint(Func<int, bool> callback, ref Vector3D point)
Destroy a proxy. This asserts if the id is invalid.
Do you have questions, comments, suggestions for improvements? Is there something I can do better? Did I make a mistake? Please add an issue here, and prefix your issue title with Wiki. Thank you, your help will be very appreciated!