public class DynamicTree extends java.lang.Object implements BroadPhaseStrategy
Modifier and Type | Class and Description |
---|---|
class |
DynamicTree.TreeNodeStack |
Modifier and Type | Field and Description |
---|---|
static int |
MAX_STACK_SIZE |
static int |
NULL_NODE |
Constructor and Description |
---|
DynamicTree() |
Modifier and Type | Method and Description |
---|---|
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,
DynamicTreeNode node,
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.
|
public static final int MAX_STACK_SIZE
public static final int NULL_NODE
public final int createProxy(AABB aabb, java.lang.Object userData)
BroadPhaseStrategy
createProxy
in interface BroadPhaseStrategy
public final void destroyProxy(int proxyId)
BroadPhaseStrategy
destroyProxy
in interface BroadPhaseStrategy
public final boolean moveProxy(int proxyId, AABB aabb, Vec2 displacement)
BroadPhaseStrategy
moveProxy
in interface BroadPhaseStrategy
public final java.lang.Object getUserData(int proxyId)
getUserData
in interface BroadPhaseStrategy
public final AABB getFatAABB(int proxyId)
getFatAABB
in interface BroadPhaseStrategy
public final void query(TreeCallback callback, AABB aabb)
BroadPhaseStrategy
query
in interface BroadPhaseStrategy
public void raycast(TreeRayCastCallback callback, RayCastInput input)
BroadPhaseStrategy
raycast
in interface BroadPhaseStrategy
callback
- a callback class that is called for each proxy that is hit by the ray.input
- the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).public final int computeHeight()
BroadPhaseStrategy
computeHeight
in interface BroadPhaseStrategy
public void validate()
public int getHeight()
BroadPhaseStrategy
getHeight
in interface BroadPhaseStrategy
public int getMaxBalance()
BroadPhaseStrategy
getMaxBalance
in interface BroadPhaseStrategy
public float getAreaRatio()
BroadPhaseStrategy
getAreaRatio
in interface BroadPhaseStrategy
public void rebuildBottomUp()
public int getInsertionCount()
getInsertionCount
in interface BroadPhaseStrategy
public void drawTree(DebugDraw argDraw)
drawTree
in interface BroadPhaseStrategy
public void drawTree(DebugDraw argDraw, DynamicTreeNode node, int spot, int height)
Copyright © 2017. All Rights Reserved.