|
|
| b2DynamicTree () |
| | Constructing the tree initializes the node pool.
|
| |
|
| ~b2DynamicTree () |
| | Destroy the tree, freeing the node pool.
|
| |
|
int32 | CreateProxy (const b2AABB &aabb, void *userData) |
| | Create a proxy. Provide a tight fitting AABB and a userData pointer.
|
| |
|
void | DestroyProxy (int32 proxyId) |
| | Destroy a proxy. This asserts if the id is invalid.
|
| |
| bool | MoveProxy (int32 proxyId, const b2AABB &aabb1, const b2Vec2 &displacement) |
| |
| void * | GetUserData (int32 proxyId) const |
| |
|
bool | WasMoved (int32 proxyId) const |
| |
|
void | ClearMoved (int32 proxyId) |
| |
|
const b2AABB & | GetFatAABB (int32 proxyId) const |
| | Get the fat AABB for a proxy.
|
| |
| template<typename T > |
| void | Query (T *callback, const b2AABB &aabb) const |
| |
| template<typename T > |
| void | RayCast (T *callback, const b2RayCastInput &input) const |
| |
|
void | Validate () const |
| | Validate this tree. For testing.
|
| |
| int32 | GetHeight () const |
| |
| int32 | GetMaxBalance () const |
| |
|
float | GetAreaRatio () const |
| | Get the ratio of the sum of the node areas to the root area.
|
| |
|
void | RebuildBottomUp () |
| | Build an optimal tree. Very expensive. For testing.
|
| |
| void | ShiftOrigin (const b2Vec2 &newOrigin) |
| |
A dynamic AABB tree broad-phase, inspired by Nathanael Presson's btDbvt. A dynamic tree arranges data in a binary tree to accelerate queries such as volume queries and ray casts. Leafs are proxies with an AABB. In the tree we expand the proxy AABB by b2_fatAABBFactor so that the proxy AABB 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.