| Package | Box2D.Collision |
| Interface | public interface IBroadPhase |
| Implementors | b2DynamicTreeBroadPhase |
| Source | IBroadPhase.as |
| Method | Defined by | ||
|---|---|---|---|
|
CreateProxy(aabb:b2AABB, userData:*):*
Create a proxy with an initial AABB.
| IBroadPhase | ||
|
DestroyProxy(proxy:*):void
Destroy a proxy.
| IBroadPhase | ||
|
GetFatAABB(proxy:*):b2AABB
Get the fat AABB for a proxy.
| IBroadPhase | ||
|
GetProxyCount():int
Get the number of proxies.
| IBroadPhase | ||
|
GetUserData(proxy:*):*
Get user data from a proxy.
| IBroadPhase | ||
|
Call MoveProxy as many times as you like, then when you are done
call UpdatePairs to finalized the proxy pairs (for your time step).
| IBroadPhase | ||
|
Query an AABB for overlapping proxies.
| IBroadPhase | ||
|
RayCast(callback:Function, input:b2RayCastInput):void
Ray-cast agains the proxies in the tree.
| IBroadPhase | ||
|
Rebalance(iterations:int):void
Give the broadphase a chance for structural optimizations
| IBroadPhase | ||
|
TestOverlap(proxyA:*, proxyB:*):Boolean
| IBroadPhase | ||
|
UpdatePairs(callback:Function):void
Update the pairs.
| IBroadPhase | ||
|
Validate():void
For debugging, throws in invariants have been broken
| IBroadPhase | ||
| CreateProxy | () | method |
public function CreateProxy(aabb:b2AABB, userData:*):*Create a proxy with an initial AABB. Pairs are not reported until UpdatePairs is called.
Parametersaabb:b2AABB |
|
userData:* |
* |
| DestroyProxy | () | method |
public function DestroyProxy(proxy:*):voidDestroy a proxy. It is up to the client to remove any pairs.
Parametersproxy:* |
| GetFatAABB | () | method |
public function GetFatAABB(proxy:*):b2AABBGet the fat AABB for a proxy.
Parametersproxy:* |
b2AABB |
| GetProxyCount | () | method |
public function GetProxyCount():intGet the number of proxies.
Returnsint |
| GetUserData | () | method |
public function GetUserData(proxy:*):*Get user data from a proxy. Returns null if the proxy is invalid.
Parametersproxy:* |
* |
| MoveProxy | () | method |
public function MoveProxy(proxy:*, aabb:b2AABB, displacement:b2Vec2):voidCall MoveProxy as many times as you like, then when you are done call UpdatePairs to finalized the proxy pairs (for your time step).
Parametersproxy:* |
|
aabb:b2AABB |
|
displacement:b2Vec2 |
| Query | () | method |
public function Query(callback:Function, aabb:b2AABB):voidQuery an AABB for overlapping proxies. The callback class is called with each proxy that overlaps the supplied AABB, and return a Boolean indicating if the broaphase should proceed to the next match.
Parameterscallback:Function — This function should be a function matching signature
function Callback(proxy::Boolean
|
|
aabb:b2AABB |
| RayCast | () | method |
public function RayCast(callback:Function, input:b2RayCastInput):voidRay-cast agains the proxies in the tree. This relies on the callback to perform exact ray-cast in the case where the proxy contains a shape The callback also performs any collision filtering
Parameterscallback:Function — This function should be a function matching signature
function Callback(subInput:b2RayCastInput, proxy::Number
Where the returned number is the new value for maxFraction
|
|
input:b2RayCastInput |
| Rebalance | () | method |
public function Rebalance(iterations:int):voidGive the broadphase a chance for structural optimizations
Parametersiterations:int |
| TestOverlap | () | method |
public function TestOverlap(proxyA:*, proxyB:*):BooleanParameters
proxyA:* |
|
proxyB:* |
Boolean |
| UpdatePairs | () | method |
public function UpdatePairs(callback:Function):voidUpdate the pairs. This results in pair callbacks. This can only add pairs.
Parameterscallback:Function |
| Validate | () | method |
public function Validate():voidFor debugging, throws in invariants have been broken