Space Engineers
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
VRageMath.MyDynamicAABBTreeD Class Reference

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

Detailed Description

Dynamic aabb tree implementation as a prunning structure

Definition at line 17 of file MyDynamicAABBTreeD.cs.

Constructor & Destructor Documentation

VRageMath.MyDynamicAABBTreeD.MyDynamicAABBTreeD ( Vector3D  extension,
double  aabbMultiplier = 1 
)
inline

constructing the tree initializes the node pool.

Definition at line 93 of file MyDynamicAABBTreeD.cs.

Member Function Documentation

int VRageMath.MyDynamicAABBTreeD.AddProxy ( ref BoundingBoxD  aabb,
object  userData,
uint  userFlags,
bool  rebalance = true 
)
inline

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

Parameters
aabbThe aabb.
userDataThe user data.
Returns

Definition at line 133 of file MyDynamicAABBTreeD.cs.

int VRageMath.MyDynamicAABBTreeD.Balance ( int  iA)
inline

Definition at line 727 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.Clear ( )
inline

Definition at line 1522 of file MyDynamicAABBTreeD.cs.

int VRageMath.MyDynamicAABBTreeD.CountLeaves ( int  nodeId)
inline

Definition at line 409 of file MyDynamicAABBTreeD.cs.

static void VRageMath.MyDynamicAABBTreeD.Dispose ( )
inlinestatic

Definition at line 1530 of file MyDynamicAABBTreeD.cs.

BoundingBoxD VRageMath.MyDynamicAABBTreeD.GetAabb ( int  proxyId)
inline

Definition at line 330 of file MyDynamicAABBTreeD.cs.

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

Definition at line 1461 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.GetAllNodeBounds ( List< BoundingBoxD boxsList)
inline

Definition at line 1487 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.GetAproximateClustersForAabb ( ref BoundingBoxD  bbox,
double  minSize,
List< BoundingBoxD boundList 
)
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.

void VRageMath.MyDynamicAABBTreeD.GetChildren ( int  proxyId,
out int  left,
out int  right 
)
inline

Definition at line 336 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.GetFatAABB ( int  proxyId,
out BoundingBoxD  fatAABB 
)
inline

Get the fat BoundingBox for a proxy.

Parameters
proxyIdThe proxy id.
fatAABBThe fat BoundingBox.

Definition at line 359 of file MyDynamicAABBTreeD.cs.

int VRageMath.MyDynamicAABBTreeD.GetHeight ( )
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.

int VRageMath.MyDynamicAABBTreeD.GetLeafCount ( int  proxyId)
inline

Definition at line 259 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.GetNodeLeaves ( int  proxyId,
List< int >  children 
)
inline

Definition at line 296 of file MyDynamicAABBTreeD.cs.

int VRageMath.MyDynamicAABBTreeD.GetRoot ( )
inline

Definition at line 254 of file MyDynamicAABBTreeD.cs.

T VRageMath.MyDynamicAABBTreeD.GetUserData< T > ( int  proxyId)
inline

Get proxy user data.

Parameters
proxyIdThe proxy id.
Returns
the proxy user data or 0 if the id is invalid.

Definition at line 248 of file MyDynamicAABBTreeD.cs.

bool VRageMath.MyDynamicAABBTreeD.MoveProxy ( int  proxyId,
ref BoundingBoxD  aabb,
Vector3D  displacement 
)
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.

Parameters
proxyIdThe proxy id.
aabbThe aabb.
displacementThe displacement.
Returns
true if the proxy was re-inserted.

Definition at line 182 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.OverlapAllBoundingBox< T > ( ref BoundingBoxD  bbox,
List< T >  elementsList,
uint  requiredFlags = 0,
bool  clear = true 
)
inline

Definition at line 1286 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.OverlapAllBoundingSphere< T > ( ref BoundingSphereD  sphere,
List< T >  overlapElementsList,
bool  clear = true 
)
inline

Definition at line 1417 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.OverlapAllFrustum< T > ( ref BoundingFrustumD  frustum,
List< T >  elementsList,
bool  clear = true 
)
inline

Definition at line 871 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.OverlapAllFrustum< T > ( ref BoundingFrustumD  frustum,
List< T >  elementsList,
uint  requiredFlags,
bool  clear = true 
)
inline

Definition at line 876 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.OverlapAllFrustum< T > ( ref BoundingFrustumD  frustum,
List< T >  elementsList,
List< bool >  isInsideList,
uint  requiredFlags,
bool  clear = true 
)
inline

Definition at line 1034 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.OverlapAllFrustum< T > ( ref BoundingFrustumD  frustum,
List< T >  elementsList,
List< bool >  isInsideList,
float  projectionFactor,
float  ignoreThr,
uint  requiredFlags,
bool  clear = true 
)
inline

Definition at line 1123 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.OverlapAllFrustumAny< T > ( ref BoundingFrustumD  frustum,
List< T >  elementsList,
bool  clear = true 
)
inline

Definition at line 958 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.OverlapAllLineSegment< T > ( ref LineD  line,
List< MyLineSegmentOverlapResult< T >>  elementsList,
bool  clear = true 
)
inline

Definition at line 1223 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.OverlapAllLineSegment< T > ( ref LineD  line,
List< MyLineSegmentOverlapResult< T >>  elementsList,
uint  requiredFlags,
bool  clear = true 
)
inline

Definition at line 1228 of file MyDynamicAABBTreeD.cs.

bool VRageMath.MyDynamicAABBTreeD.OverlapsAnyLeafBoundingBox ( ref BoundingBoxD  bbox)
inline

Definition at line 1334 of file MyDynamicAABBTreeD.cs.

void VRageMath.MyDynamicAABBTreeD.Query ( Func< int, bool >  callback,
ref BoundingBoxD  aabb 
)
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.

void VRageMath.MyDynamicAABBTreeD.RemoveProxy ( int  proxyId)
inline

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

Parameters
proxyIdThe proxy id.

Definition at line 159 of file MyDynamicAABBTreeD.cs.

Member Data Documentation

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.


The documentation for this class was generated from the following file: