Space Engineers
|
Dynamic aabb tree implementation as a prunning structure More...
Classes | |
class | DynamicTreeNode |
A dynamic BoundingBox tree broad-phase, inspired by Nathanael Presson's btDbvt. | |
Public Member Functions | |
MyDynamicAABBTreeD (Vector3D extension, double aabbMultiplier=1) | |
constructing the tree initializes the node pool. More... | |
int | AddProxy (ref BoundingBoxD aabb, object userData, uint userFlags, bool rebalance=true) |
Create a proxy. Provide a tight fitting BoundingBox and a userData pointer. More... | |
void | RemoveProxy (int proxyId) |
Destroy a proxy. This asserts if the id is invalid. More... | |
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. More... | |
T | GetUserData< T > (int proxyId) |
Get proxy user data. More... | |
int | GetRoot () |
int | GetLeafCount (int proxyId) |
void | GetNodeLeaves (int proxyId, List< int > children) |
BoundingBoxD | GetAabb (int proxyId) |
void | GetChildren (int proxyId, out int left, out int right) |
void | GetFatAABB (int proxyId, out BoundingBoxD fatAABB) |
Get the fat BoundingBox for a proxy. More... | |
void | Query (Func< int, bool > callback, ref BoundingBoxD aabb) |
int | CountLeaves (int nodeId) |
int | GetHeight () |
int | Balance (int iA) |
void | OverlapAllFrustum< T > (ref BoundingFrustumD frustum, List< T > elementsList, bool clear=true) |
void | OverlapAllFrustum< T > (ref BoundingFrustumD frustum, List< T > elementsList, uint requiredFlags, bool clear=true) |
void | OverlapAllFrustumAny< T > (ref BoundingFrustumD frustum, List< T > elementsList, bool clear=true) |
void | OverlapAllFrustum< T > (ref BoundingFrustumD frustum, List< T > elementsList, List< bool > isInsideList, uint requiredFlags, bool clear=true) |
void | OverlapAllFrustum< T > (ref BoundingFrustumD frustum, List< T > elementsList, List< bool > isInsideList, float projectionFactor, float ignoreThr, uint requiredFlags, bool clear=true) |
void | OverlapAllLineSegment< T > (ref LineD line, List< MyLineSegmentOverlapResult< T >> elementsList, bool clear=true) |
void | OverlapAllLineSegment< T > (ref LineD line, List< MyLineSegmentOverlapResult< T >> elementsList, uint requiredFlags, bool clear=true) |
void | OverlapAllBoundingBox< T > (ref BoundingBoxD bbox, List< T > elementsList, uint requiredFlags=0, bool clear=true) |
bool | OverlapsAnyLeafBoundingBox (ref BoundingBoxD bbox) |
void | GetAproximateClustersForAabb (ref BoundingBoxD bbox, double minSize, List< BoundingBoxD > boundList) |
void | OverlapAllBoundingSphere< T > (ref BoundingSphereD sphere, List< T > overlapElementsList, bool clear=true) |
void | GetAll< T > (List< T > elementsList, bool clear, List< BoundingBoxD > boxsList=null) |
void | GetAllNodeBounds (List< BoundingBoxD > boxsList) |
void | Clear () |
Static Public Member Functions | |
static void | Dispose () |
Public Attributes | |
const int | NullNode = -1 |
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. More... | |
Dynamic aabb tree implementation as a prunning structure
Definition at line 17 of file MyDynamicAABBTreeD.cs.
|
inline |
constructing the tree initializes the node pool.
Definition at line 93 of file MyDynamicAABBTreeD.cs.
|
inline |
Create a proxy. Provide a tight fitting BoundingBox and a userData pointer.
aabb | The aabb. |
userData | The user data. |
Definition at line 133 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 727 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1522 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 409 of file MyDynamicAABBTreeD.cs.
|
inlinestatic |
Definition at line 1530 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 330 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1461 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1487 of file MyDynamicAABBTreeD.cs.
|
inline |
Use the tree to produce a list of clusters aproximatelly the requested size, while intersecting those with the provided bounding box.
Definition at line 1377 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 336 of file MyDynamicAABBTreeD.cs.
|
inline |
Get the fat BoundingBox for a proxy.
proxyId | The proxy id. |
fatAABB | The fat BoundingBox. |
Definition at line 359 of file MyDynamicAABBTreeD.cs.
|
inline |
Compute the height of the binary tree in O(N) time. Should not be called often.
Definition at line 712 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 259 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 296 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 254 of file MyDynamicAABBTreeD.cs.
|
inline |
Get proxy user data.
proxyId | The proxy id. |
Definition at line 248 of file MyDynamicAABBTreeD.cs.
|
inline |
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.
proxyId | The proxy id. |
aabb | The aabb. |
displacement | The displacement. |
Definition at line 182 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1286 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1417 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 871 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 876 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1034 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1123 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 958 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1223 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1228 of file MyDynamicAABBTreeD.cs.
|
inline |
Definition at line 1334 of file MyDynamicAABBTreeD.cs.
|
inline |
Query an BoundingBox for overlapping proxies. The callback class is called for each proxy that overlaps the supplied BoundingBox.
Definition at line 370 of file MyDynamicAABBTreeD.cs.
|
inline |
Destroy a proxy. This asserts if the id is invalid.
proxyId | The proxy id. |
Definition at line 159 of file MyDynamicAABBTreeD.cs.
const int VRageMath.MyDynamicAABBTreeD.NullNode = -1 |
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.
Definition at line 55 of file MyDynamicAABBTreeD.cs.