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 | |
MyDynamicAABBTree (Vector3 extension, float aabbMultiplier=1) | |
constructing the tree initializes the node pool. More... | |
int | AddProxy (ref BoundingBox 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 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. More... | |
T | GetUserData< T > (int proxyId) |
Get proxy user data. More... | |
int | GetRoot () |
int | GetLeafCount (int proxyId) |
void | GetNodeLeaves (int proxyId, List< int > children) |
BoundingBox | GetAabb (int proxyId) |
void | GetChildren (int proxyId, out int left, out int right) |
void | GetFatAABB (int proxyId, out BoundingBox fatAABB) |
Get the fat BoundingBox for a proxy. More... | |
void | Query (Func< int, bool > callback, ref BoundingBox aabb) |
int | CountLeaves (int nodeId) |
int | GetHeight () |
int | Balance (int iA) |
void | OverlapAllFrustum< T > (ref BoundingFrustum frustum, List< T > elementsList, bool clear=true) |
void | OverlapAllFrustum< T > (ref BoundingFrustum frustum, List< T > elementsList, uint requiredFlags, bool clear=true) |
void | OverlapAllFrustum< T > (ref BoundingFrustum frustum, List< T > elementsList, List< bool > isInsideList, uint requiredFlags, bool clear=true) |
void | OverlapAllFrustum< T > (ref BoundingFrustum frustum, List< T > elementsList, List< bool > isInsideList, Vector3 projectionDir, float projectionFactor, float ignoreThr, uint requiredFlags, bool clear=true) |
void | OverlapAllFrustumConservative< T > (ref BoundingFrustum frustum, List< T > elementsList, uint requiredFlags, bool clear=true) |
void | OverlapAllFrustumAny< T > (ref BoundingFrustum frustum, List< T > elementsList, bool clear=true) |
void | OverlapAllLineSegment< T > (ref Line line, List< MyLineSegmentOverlapResult< T >> elementsList) |
void | OverlapAllLineSegment< T > (ref Line line, List< MyLineSegmentOverlapResult< T >> elementsList, uint requiredFlags) |
void | OverlapAllBoundingBox< T > (ref BoundingBox bbox, List< T > elementsList, uint requiredFlags=0, bool clear=true) |
bool | OverlapsAnyLeafBoundingBox (ref BoundingBox bbox) |
void | OverlapSizeableClusters (ref BoundingBox bbox, List< BoundingBox > boundList, double minSize) |
void | OverlapAllBoundingSphere< T > (ref BoundingSphere sphere, List< T > overlapElementsList, bool clear=true) |
void | GetAll< T > (List< T > elementsList, bool clear, List< BoundingBox > boxsList=null) |
void | GetAllNodeBounds (List< BoundingBox > 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 16 of file MyDynamicAABBTree.cs.
|
inline |
constructing the tree initializes the node pool.
Definition at line 93 of file MyDynamicAABBTree.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 MyDynamicAABBTree.cs.
|
inline |
Definition at line 729 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1603 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 409 of file MyDynamicAABBTree.cs.
|
inlinestatic |
Definition at line 1611 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 330 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1541 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1567 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 336 of file MyDynamicAABBTree.cs.
|
inline |
Get the fat BoundingBox for a proxy.
proxyId | The proxy id. |
fatAABB | The fat BoundingBox. |
Definition at line 359 of file MyDynamicAABBTree.cs.
|
inline |
Compute the height of the binary tree in O(N) time. Should not be called often.
Definition at line 714 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 259 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 296 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 254 of file MyDynamicAABBTree.cs.
|
inline |
Get proxy user data.
proxyId | The proxy id. |
Definition at line 248 of file MyDynamicAABBTree.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 MyDynamicAABBTree.cs.
|
inline |
Definition at line 1366 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1497 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 873 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 878 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 960 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1049 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1228 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1146 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1304 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1309 of file MyDynamicAABBTree.cs.
|
inline |
Definition at line 1414 of file MyDynamicAABBTree.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 1457 of file MyDynamicAABBTree.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 MyDynamicAABBTree.cs.
|
inline |
Destroy a proxy. This asserts if the id is invalid.
proxyId | The proxy id. |
Definition at line 159 of file MyDynamicAABBTree.cs.
const int VRageMath.MyDynamicAABBTree.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 54 of file MyDynamicAABBTree.cs.