public class DefaultBroadPhaseBuffer extends Object implements TreeCallback, BroadPhase
NULL_PROXY| Constructor and Description |
|---|
DefaultBroadPhaseBuffer(BroadPhaseStrategy strategy) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bufferMove(int proxyId) |
int |
createProxy(AABB aabb,
Object userData)
Create a proxy with an initial AABB.
|
void |
destroyProxy(int proxyId)
Destroy a proxy.
|
void |
drawTree(DebugDraw argDraw) |
AABB |
getFatAABB(int proxyId) |
int |
getProxyCount()
Get the number of proxies.
|
int |
getTreeBalance() |
int |
getTreeHeight()
Get the height of the embedded tree.
|
float |
getTreeQuality() |
Object |
getUserData(int proxyId) |
void |
moveProxy(int proxyId,
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(int proxyIdA,
int proxyIdB) |
void |
touchProxy(int proxyId) |
boolean |
treeCallback(int proxyId)
This is called from DynamicTree::query when we are gathering pairs.
|
protected void |
unbufferMove(int proxyId) |
void |
updatePairs(PairCallback callback)
Update the pairs.
|
public DefaultBroadPhaseBuffer(BroadPhaseStrategy strategy)
public final int createProxy(AABB aabb, Object userData)
BroadPhasecreateProxy in interface BroadPhasepublic final void destroyProxy(int proxyId)
BroadPhasedestroyProxy in interface BroadPhasepublic final void moveProxy(int proxyId,
AABB aabb,
Vec2 displacement)
BroadPhasemoveProxy in interface BroadPhasepublic void touchProxy(int proxyId)
touchProxy in interface BroadPhasepublic Object getUserData(int proxyId)
getUserData in interface BroadPhasepublic AABB getFatAABB(int proxyId)
getFatAABB in interface BroadPhasepublic boolean testOverlap(int proxyIdA,
int proxyIdB)
testOverlap in interface BroadPhasepublic final int getProxyCount()
BroadPhasegetProxyCount in interface BroadPhasepublic void drawTree(DebugDraw argDraw)
drawTree in interface BroadPhasepublic final void updatePairs(PairCallback callback)
BroadPhaseupdatePairs in interface BroadPhasepublic final void query(TreeCallback callback, AABB aabb)
BroadPhasequery in interface BroadPhasepublic final void raycast(TreeRayCastCallback callback, RayCastInput input)
BroadPhaseraycast in interface BroadPhasecallback - 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 getTreeHeight()
BroadPhasegetTreeHeight in interface BroadPhasepublic int getTreeBalance()
getTreeBalance in interface BroadPhasepublic float getTreeQuality()
getTreeQuality in interface BroadPhaseprotected final void bufferMove(int proxyId)
protected final void unbufferMove(int proxyId)
public final boolean treeCallback(int proxyId)
treeCallback in interface TreeCallbackproxyId - the id of the proxyCopyright © 2018. All rights reserved.