|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jbox2d.collision.broadphase.DynamicTree
public class DynamicTree
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.
| Field Summary | |
|---|---|
static int |
MAX_STACK_SIZE
|
| Constructor Summary | |
|---|---|
DynamicTree()
|
|
| Method Summary | |
|---|---|
int |
computeHeight()
Compute the height of the tree. |
DynamicTreeNode |
createProxy(AABB argAABB,
Object argUserData)
Create a proxy. |
void |
destroyProxy(DynamicTreeNode argProxy)
Destroy a proxy |
void |
drawTree(DebugDraw argDraw)
|
void |
drawTree(DebugDraw argDraw,
DynamicTreeNode argNode,
int spot,
int height)
|
boolean |
moveProxy(DynamicTreeNode argProxy,
AABB argAABB,
Vec2 displacement)
Move a proxy with a swepted AABB. |
void |
query(TreeCallback argCallback,
AABB argAABB)
Query an AABB for overlapping proxies. |
boolean |
raycast(DynamicTreeNode argNode,
RayCastInput argInput,
int argCount,
AABB argSegAABB,
Vec2 argV,
Vec2 argP1,
Vec2 argP2,
Vec2 argAbs_v,
float[] argMaxFraction,
TreeRayCastCallback argCallback)
|
void |
raycast(TreeRayCastCallback argCallback,
RayCastInput argInput)
Ray-cast against the proxies in the tree. |
void |
rebalance(int argIterations)
Rebalances the tree for the given iterations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_STACK_SIZE
| Constructor Detail |
|---|
public DynamicTree()
| Method Detail |
|---|
public final DynamicTreeNode createProxy(AABB argAABB,
Object argUserData)
argAABB - userData -
public final void destroyProxy(DynamicTreeNode argProxy)
argProxy -
public final boolean moveProxy(DynamicTreeNode argProxy,
AABB argAABB,
Vec2 displacement)
public final void rebalance(int argIterations)
argIterations -
public final void query(TreeCallback argCallback,
AABB argAABB)
argCallback - argAABB -
public void raycast(TreeRayCastCallback argCallback,
RayCastInput argInput)
argInput - the ray-cast input data. The ray extends from p1 to p1 + maxFraction *
(p2 - p1).argCallback - a callback class that is called for each proxy that is hit by the ray.
public boolean raycast(DynamicTreeNode argNode,
RayCastInput argInput,
int argCount,
AABB argSegAABB,
Vec2 argV,
Vec2 argP1,
Vec2 argP2,
Vec2 argAbs_v,
float[] argMaxFraction,
TreeRayCastCallback argCallback)
public final int computeHeight()
public void drawTree(DebugDraw argDraw)
public void drawTree(DebugDraw argDraw,
DynamicTreeNode argNode,
int spot,
int height)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||