|
||||||||||
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 _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. |
int |
createProxy(AABB aabb,
java.lang.Object userData)
Create a proxy. |
void |
destroyProxy(int proxyId)
Destroy a proxy |
void |
drawTree(DebugDraw argDraw)
|
void |
drawTree(DebugDraw argDraw,
int nodeId,
int spot,
int height)
|
float |
getAreaRatio()
Get the ratio of the sum of the node areas to the root area. |
AABB |
getFatAABB(int proxyId)
|
int |
getHeight()
Compute the height of the binary tree in O(N) time. |
int |
getInsertionCount()
|
int |
getMaxBalance()
Get the maximum balance of an node in the tree. |
java.lang.Object |
getUserData(int proxyId)
|
boolean |
moveProxy(int proxyId,
AABB aabb,
Vec2 displacement)
Move a proxy with a swepted AABB. |
void |
query(TreeCallback callback,
AABB aabb)
Query an AABB for overlapping proxies. |
void |
raycast(TreeRayCastCallback callback,
RayCastInput input)
Ray-cast against the proxies in the tree. |
void |
rebuildBottomUp()
Build an optimal tree. |
void |
validate()
Validate this tree. |
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 int createProxy(AABB aabb, java.lang.Object userData)
aabb
- userData
-
public final void destroyProxy(int proxyId)
proxyId
- public final boolean moveProxy(int proxyId, AABB aabb, Vec2 displacement)
public final java.lang.Object getUserData(int proxyId)
public final AABB getFatAABB(int proxyId)
public final void query(TreeCallback callback, AABB aabb)
callback
- araabbgAABB
- public void raycast(TreeRayCastCallback callback, RayCastInput input)
input
- the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).callback
- a callback class that is called for each proxy that is hit by the ray.public final int computeHeight()
public void validate()
public int getHeight()
public int getMaxBalance()
public float getAreaRatio()
public void rebuildBottomUp()
public int getInsertionCount()
public void drawTree(DebugDraw argDraw)
public void drawTree(DebugDraw argDraw, int nodeId, int spot, int height)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |