|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbox2d.collision.broadphase.BroadPhase
public class BroadPhase
The broad-phase is used for computing pairs and performing volume queries and ray casts. This broad-phase does not persist pairs. Instead, this reports potentially new pairs. It is up to the client to consume the new pairs and to track subsequent overlap.
Field Summary | |
---|---|
static int |
NULL_PROXY
|
Constructor Summary | |
---|---|
BroadPhase()
|
Method Summary | |
---|---|
protected void |
bufferMove(DynamicTreeNode node)
|
int |
computeHeight()
Compute the height of the embedded tree. |
DynamicTreeNode |
createProxy(AABB aabb,
Object userData)
Create a proxy with an initial AABB. |
void |
destroyProxy(DynamicTreeNode proxy)
Destroy a proxy. |
void |
drawTree(DebugDraw argDraw)
|
int |
getProxyCount()
Get the number of proxies. |
void |
moveProxy(DynamicTreeNode proxy,
AABB aabb,
Vec2 displacement)
Call MoveProxy as many times as you like, then when you are done call UpdatePairs to finalized the proxy pairs (for your time step). |
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. |
boolean |
testOverlap(DynamicTreeNode proxyA,
DynamicTreeNode proxyB)
|
boolean |
treeCallback(DynamicTreeNode proxy)
This is called from DynamicTree::query when we are gathering pairs. |
protected void |
unbufferMove(DynamicTreeNode proxy)
|
void |
updatePairs(PairCallback callback)
Update the pairs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NULL_PROXY
Constructor Detail |
---|
public BroadPhase()
Method Detail |
---|
public final DynamicTreeNode createProxy(AABB aabb, Object userData)
aabb
- userData
-
public final void destroyProxy(DynamicTreeNode proxy)
proxyId
- public final void moveProxy(DynamicTreeNode proxy, AABB aabb, Vec2 displacement)
public boolean testOverlap(DynamicTreeNode proxyA, DynamicTreeNode proxyB)
public final int getProxyCount()
public void drawTree(DebugDraw argDraw)
public final void updatePairs(PairCallback callback)
callback
- public final void query(TreeCallback callback, AABB aabb)
callback
- aabb
- public final 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()
protected final void bufferMove(DynamicTreeNode node)
protected final void unbufferMove(DynamicTreeNode proxy)
public final boolean treeCallback(DynamicTreeNode proxy)
treeCallback
in interface TreeCallback
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |