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.
public function CreateProxy(aabb:b2AABB, userData:*):*
Create a proxy with an initial AABB. Pairs are not reported until
UpdatePairs is called.
Parameters
Returns
public function DestroyProxy(proxy:*):void
Destroy a proxy. It is up to the client to remove any pairs.
Parameters
public function GetFatAABB(proxy:*):b2AABB
Get the AABB for a proxy.
Parameters
Returns
public function GetProxyCount():int
Get the number of proxies.
Returns
public function GetUserData(proxy:*):*
Get user data from a proxy. Returns null if the proxy is invalid.
Parameters
Returns
public function MoveProxy(proxy:*, aabb:b2AABB, displacement:b2Vec2):void
Call MoveProxy as many times as you like, then when you are done
call UpdatePairs to finalized the proxy pairs (for your time step).
Parameters
public function Query(callback:Function, aabb:b2AABB):void
Query 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.
Parameters
| callback:Function — This function should be a function matching signature
function Callback(proxy::Boolean
|
| |
| aabb:b2AABB |
public function RayCast(callback:Function, input:b2RayCastInput):void
Ray-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
Parameters
| callback: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 |
public function Rebalance(iterations:int):voidParameters
public function TestOverlap(proxyA:*, proxyB:*):BooleanParameters
Returns
public function UpdatePairs(callback:Function):void
Update the pairs. This results in pair callbacks. This can only add pairs.
Parameters
public function Validate():void
Box2DFlash 2.1a