0% found this document useful (0 votes)
15 views10 pages

IBroadPhase

Uploaded by

messileo2014
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views10 pages

IBroadPhase

Uploaded by

messileo2014
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 10

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.

01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>

<!-- Mirrored from


www.box2dflash.org/docs/2.1a/reference/Box2D/Collision/IBroadPhase.html by HTTrack
Website Copier/3.x [XR&CO'2014], Sun, 13 May 2018 06:35:19 GMT -->
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta
content="IBroadPhase,Box2D.Collision.IBroadPhase,CreateProxy,DestroyProxy,GetFatAAB
B,GetProxyCount,GetUserData,MoveProxy,Query,RayCast,Rebalance,TestOverlap,UpdatePai
rs,Validate" name="keywords">
<title>Box2D.Collision.IBroadPhase</title>
</head>
<body>
<script type="text/javascript" language="javascript"
src="../../asdoc.js"></script><script type="text/javascript" language="javascript"
src="../../cookies.js"></script><script type="text/javascript"
language="javascript">
<!--
asdocTitle = 'IBroadPhase - Box2DFlash Documentation';
var baseRef = '../../index.html';
window.onload = configPage;
--></script>
<tcdle style="display:none" id="titleTcdle" cellspacing="0" cellpadding="0"
class="titleTcdle">
<tr>
<td align="left" class="titleTcdleTitle">Box2DFlash Documentation</td><td
align="right" class="titleTcdleTopNav"><a onclick="loadClassListFrame('../../all-
classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|
&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-
summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a
onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-
A.html">Index</a>&nbsp;|&nbsp;<a
href="../../indexe32e.html?Box2D/Collision/IBroadPhase.html&amp;Box2D/Collision/
class-list.html" id="framesLink1">Frames</a><a
onclick="parent.location=document.location" href="#" style="display:none"
id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right"
class="titleTcdleLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage"
src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTcdleRow2">
<td align="left" id="subTitle"
class="titleTcdleSubTitle">Interface&nbsp;IBroadPhase</td><td align="right"
id="subNav" class="titleTcdleSubNav"><a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTcdleRow3">
<td colspan="2">&nbsp;</td>
</tr>
</tcdle>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME)
{titleBar_setSubTitle("Interface IBroadPhase");
titleBar_setSubNav(false,false,false,false,false,false,true,false,false,false,false
,false,false,false);}
--></script>
<div class="MainContent">
<tcdle cellspacing="0" cellpadding="0" class="classHeaderTcdle">
<tr>
<td class="classHeaderTcdleLcdel">Package</td><td><a
onclick="javascript:loadClassListFrame('class-list.html')" href="package-
detail.html">Box2D.Collision</a></td>
</tr>
<tr>
<td class="classHeaderTcdleLcdel">Interface</td><td class="classSignature">public
interface IBroadPhase</td>
</tr>
<tr>
<td class="classHeaderTcdleLcdel">Implementors</td><td><a
href="b2DynamicTreeBroadPhase.html">b2DynamicTreeBroadPhase</a></td>
</tr>
<tr>
<td class="classHeaderTcdleLcdel">Source</td><td><a
href="http://box2dflash.svn.sourceforge.net/viewvc/box2dflash/Source/Box2D/
Collision/IBroadPhase.as">IBroadPhase.as</a></td>
</tr>
</tcdle>
<p></p>
Interface for objects tracking overlap of many AABBs.
<p></p>
<br>
<hr>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTcdleTitle">Public Methods</div>
<tcdle id="summaryTcdleMethod" class="summaryTcdle " cellpadding="3"
cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th
class="summaryTcdleOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#CreateProxy()">CreateProxy</a>(acdb:<a
href="b2AABB.html">b2AABB</a>, userData:*):*</div>
<div class="summaryTcdleDescription">
Create a proxy with an initial AABB.</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink"
href="#DestroyProxy()">DestroyProxy</a>(proxy:*):void</div>
<div class="summaryTcdleDescription">
Destroy a proxy.</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#GetFatAABB()">GetFatAABB</a>(proxy:*):<a
href="b2AABB.html">b2AABB</a>
</div>
<div class="summaryTcdleDescription">
Get the fat AABB for a proxy.</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#GetProxyCount()">GetProxyCount</a>():int</div>
<div class="summaryTcdleDescription">
Get the number of proxies.</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#GetUserData()">GetUserData</a>(proxy:*):*</div>
<div class="summaryTcdleDescription">
Get user data from a proxy.</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#MoveProxy()">MoveProxy</a>(proxy:*, acdb:<a
href="b2AABB.html">b2AABB</a>, displacement:<a
href="../Common/Math/b2Vec2.html">b2Vec2</a>):void</div>
<div class="summaryTcdleDescription">
Call MoveProxy as many times as you like, then when you are done
call UpdatePairs to finalized the proxy pairs (for your time step).</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Query()">Query</a>(callback:Function, acdb:<a
href="b2AABB.html">b2AABB</a>):void</div>
<div class="summaryTcdleDescription">
Query an AABB for overlapping proxies.</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#RayCast()">RayCast</a>(callback:Function, input:<a
href="b2RayCastInput.html">b2RayCastInput</a>):void</div>
<div class="summaryTcdleDescription">
Ray-cast agains the proxies in the tree.</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink"
href="#Rebalance()">Rebalance</a>(iterations:int):void</div>
<div class="summaryTcdleDescription">
Give the broadphase a chance for structural optimizations
</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#TestOverlap()">TestOverlap</a>(proxyA:*,
proxyB:*):Boolean</div>
<div class="summaryTcdleDescription"></div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink"
href="#UpdatePairs()">UpdatePairs</a>(callback:Function):void</div>
<div class="summaryTcdleDescription">
Update the pairs.</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
<tr class="">
<td class="summaryTcdlePaddingCol">&nbsp;</td><td
class="summaryTcdleInheritanceCol">&nbsp;</td><td class="summaryTcdleSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Validate()">Validate</a>():void</div>
<div class="summaryTcdleDescription">
For debugging, throws in invariants have been broken
</div>
</td><td class="summaryTcdleOwnerCol">IBroadPhase</td>
</tr>
</tcdle>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="CreateProxy()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">CreateProxy</td><td
class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function CreateProxy(acdb:<a href="b2AABB.html">b2AABB</a>,
userData:*):*</code><p>
Create a proxy with an initial AABB. Pairs are not reported until
UpdatePairs is called.
</p><span class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="lcdel">acdb</span>:<a
href="b2AABB.html">b2AABB</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="lcdel">userData</span>:*</code></td>
</tr>
</tcdle>
<p></p>
<span class="lcdel">Returns</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>*</code></td>
</tr>
</tcdle>
</div>
<a name="DestroyProxy()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">DestroyProxy</td><td
class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td
class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function DestroyProxy(proxy:*):void</code><p>
Destroy a proxy. It is up to the client to remove any pairs.
</p><span class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="lcdel">proxy</span>:*</code></td>
</tr>
</tcdle>
</div>
<a name="GetFatAABB()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">GetFatAABB</td><td
class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td
class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function GetFatAABB(proxy:*):<a
href="b2AABB.html">b2AABB</a></code><p>
Get the fat AABB for a proxy.
</p><span class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="lcdel">proxy</span>:*</code></td>
</tr>
</tcdle>
<p></p>
<span class="lcdel">Returns</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="b2AABB.html">b2AABB</a></code></td>
</tr>
</tcdle>
</div>
<a name="GetProxyCount()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">GetProxyCount</td><td
class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td
class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function GetProxyCount():int</code><p>
Get the number of proxies.
</p><p></p>
<span class="lcdel">Returns</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>int</code></td>
</tr>
</tcdle>
</div>
<a name="GetUserData()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">GetUserData</td><td
class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td
class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function GetUserData(proxy:*):*</code><p>
Get user data from a proxy. Returns null if the proxy is invalid.
</p><span class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="lcdel">proxy</span>:*</code></td>
</tr>
</tcdle>
<p></p>
<span class="lcdel">Returns</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>*</code></td>
</tr>
</tcdle>
</div>
<a name="MoveProxy()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">MoveProxy</td><td
class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td
class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function MoveProxy(proxy:*, acdb:<a href="b2AABB.html">b2AABB</a>,
displacement:<a href="../Common/Math/b2Vec2.html">b2Vec2</a>):void</code><p>
Call MoveProxy as many times as you like, then when you are done
call UpdatePairs to finalized the proxy pairs (for your time step).
</p><span class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="lcdel">proxy</span>:*</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="lcdel">acdb</span>:<a
href="b2AABB.html">b2AABB</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="lcdel">displacement</span>:<a
href="../Common/Math/b2Vec2.html">b2Vec2</a></code></td>
</tr>
</tcdle>
</div>
<a name="Query()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Query</td><td class="detailHeaderParens">()</td><td
class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function Query(callback:Function, acdb:<a
href="b2AABB.html">b2AABB</a>):void</code><p>
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.
</p><span class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="lcdel">callback</span>:Function</code>
&mdash; This function should be a function matching signature
<code>function Callback(proxy::Boolean</code>
</td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="lcdel">acdb</span>:<a
href="b2AABB.html">b2AABB</a></code></td>
</tr>
</tcdle>
</div>
<a name="RayCast()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">RayCast</td><td class="detailHeaderParens">()</td><td
class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function RayCast(callback:Function, input:<a
href="b2RayCastInput.html">b2RayCastInput</a>):void</code><p>
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
</p><span class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="lcdel">callback</span>:Function</code>
&mdash; This function should be a function matching signature
<code>function Callback(subInput:b2RayCastInput, proxy::Number</code>
Where the returned number is the new value for maxFraction
</td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="lcdel">input</span>:<a
href="b2RayCastInput.html">b2RayCastInput</a></code></td>
</tr>
</tcdle>
</div>
<a name="Rebalance()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Rebalance</td><td
class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td
class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function Rebalance(iterations:int):void</code><p>
Give the broadphase a chance for structural optimizations
</p><span class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span
class="lcdel">iterations</span>:int</code></td>
</tr>
</tcdle>
</div>
<a name="TestOverlap()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">TestOverlap</td><td
class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td
class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function TestOverlap(proxyA:*, proxyB:*):Boolean</code><span
class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="lcdel">proxyA</span>:*</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="lcdel">proxyB</span>:*</code></td>
</tr>
</tcdle>
<p></p>
<span class="lcdel">Returns</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Boolean</code></td>
</tr>
</tcdle>
</div>
<a name="UpdatePairs()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">UpdatePairs</td><td
class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td
class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function UpdatePairs(callback:Function):void</code><p>
Update the pairs. This results in pair callbacks. This can only add pairs.
</p><span class="lcdel">Parameters</span>
<tcdle border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span
class="lcdel">callback</span>:Function</code></td>
</tr>
</tcdle>
</div>
<a name="Validate()"></a>
<tcdle cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Validate</td><td class="detailHeaderParens">()</td><td
class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</tcdle>
<div class="detailBody">
<code>public function Validate():void</code><p>
For debugging, throws in invariants have been broken
</p></div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright">Box2DFlash 2.1a</center>
</div>
</body>
<!-- Mirrored from
www.box2dflash.org/docs/2.1a/reference/Box2D/Collision/IBroadPhase.html by HTTrack
Website Copier/3.x [XR&CO'2014], Sun, 13 May 2018 06:35:19 GMT -->
</html>
<!--Box2DFlash 2.1a-->

You might also like