UNPKG

pixi-cull

Version:

a library to visibly cull objects designed to work with pixi.js

865 lines 57 kB
<!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>SpatialHash | pixi-cull</title> <meta name="description" content="Documentation for pixi-cull"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> <script async src="../assets/js/search.js" id="search-script"></script> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">pixi-cull</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../modules.html">pixi-cull</a> </li> <li> <a href="spatialhash.html">SpatialHash</a> </li> </ul> <h1>Class SpatialHash</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">SpatialHash</span> </li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section "> <h3>Constructors</h3> <ul class="tsd-index-list"> <li class="tsd-kind-constructor tsd-parent-kind-class"><a href="spatialhash.html#constructor" class="tsd-kind-icon">constructor</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Properties</h3> <ul class="tsd-index-list"> <li class="tsd-kind-property tsd-parent-kind-class"><a href="spatialhash.html#dirtytest" class="tsd-kind-icon">dirty<wbr>Test</a></li> <li class="tsd-kind-property tsd-parent-kind-class"><a href="spatialhash.html#simpletest" class="tsd-kind-icon">simple<wbr>Test</a></li> </ul> </section> <section class="tsd-index-section "> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#add" class="tsd-kind-icon">add</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#addcontainer" class="tsd-kind-icon">add<wbr>Container</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#cull" class="tsd-kind-icon">cull</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#getaveragesize" class="tsd-kind-icon">get<wbr>Average<wbr>Size</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#getbuckets" class="tsd-kind-icon">get<wbr>Buckets</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#getlargest" class="tsd-kind-icon">get<wbr>Largest</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#getnumberofbuckets" class="tsd-kind-icon">get<wbr>Number<wbr>OfBuckets</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#getsparseness" class="tsd-kind-icon">get<wbr>Sparseness</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#getworldbounds" class="tsd-kind-icon">get<wbr>World<wbr>Bounds</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#insert" class="tsd-kind-icon">insert</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#invisible" class="tsd-kind-icon">invisible</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#neighbors" class="tsd-kind-icon">neighbors</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#query" class="tsd-kind-icon">query</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#querycallback" class="tsd-kind-icon">query<wbr>Callback</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#querycallbackall" class="tsd-kind-icon">query<wbr>Callback<wbr>All</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#remove" class="tsd-kind-icon">remove</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#removecontainer" class="tsd-kind-icon">remove<wbr>Container</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#removefromhash" class="tsd-kind-icon">remove<wbr>From<wbr>Hash</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#stats" class="tsd-kind-icon">stats</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#updateobject" class="tsd-kind-icon">update<wbr>Object</a></li> <li class="tsd-kind-method tsd-parent-kind-class"><a href="spatialhash.html#updateobjects" class="tsd-kind-icon">update<wbr>Objects</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Constructors</h2> <section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class"> <a name="constructor" class="tsd-anchor"></a> <h3>constructor</h3> <ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">new <wbr>Spatial<wbr>Hash<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/spatialhashoptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SpatialHashOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="spatialhash.html" class="tsd-signature-type" data-tsd-kind="Class">SpatialHash</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L66">code/spatial-hash.ts:66</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>creates a spatial-hash cull Note, options.dirtyTest defaults to false. To greatly improve performance set to true and set displayObject.dirty=true when the displayObject changes)</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> options: <a href="../interfaces/spatialhashoptions.html" class="tsd-signature-type" data-tsd-kind="Interface">SpatialHashOptions</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="spatialhash.html" class="tsd-signature-type" data-tsd-kind="Class">SpatialHash</a></h4> </li> </ul> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Properties</h2> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="dirtytest" class="tsd-anchor"></a> <h3>dirty<wbr>Test</h3> <div class="tsd-signature tsd-kind-icon">dirty<wbr>Test<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L51">code/spatial-hash.ts:51</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>dirtyTest toggle</p> </div> </div> </section> <section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-class"> <a name="simpletest" class="tsd-anchor"></a> <h3>simple<wbr>Test</h3> <div class="tsd-signature tsd-kind-icon">simple<wbr>Test<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></div> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L48">code/spatial-hash.ts:48</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>simpleTest toggle</p> </div> </div> </section> </section> <section class="tsd-panel-group tsd-member-group "> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="add" class="tsd-anchor"></a> <h3>add</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">add<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a>, staticObject<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L103">code/spatial-hash.ts:103</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>add an object to be culled side effect: adds object.spatialHashes to track existing hashes</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h5> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> staticObject: <span class="tsd-signature-type">boolean</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h4> <p>object</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="addcontainer" class="tsd-anchor"></a> <h3>add<wbr>Container</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">add<wbr>Container<span class="tsd-signature-symbol">(</span>container<span class="tsd-signature-symbol">: </span><a href="../interfaces/containerwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">ContainerWithCulling</a>, staticObject<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L132">code/spatial-hash.ts:132</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>add an array of objects to be culled</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>container: <a href="../interfaces/containerwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">ContainerWithCulling</a></h5> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> staticObject: <span class="tsd-signature-type">boolean</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="cull" class="tsd-anchor"></a> <h3>cull</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">cull<span class="tsd-signature-symbol">(</span>AABB<span class="tsd-signature-symbol">: </span><a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a>, skipUpdate<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, callback<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L180">code/spatial-hash.ts:180</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>update the hashes and cull the items in the list</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>AABB: <a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a></h5> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> skipUpdate: <span class="tsd-signature-type">boolean</span></h5> </li> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> callback: <span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">boolean</span></h5> <ul class="tsd-parameters"> <li class="tsd-parameter-signature"> <ul class="tsd-signatures tsd-kind-type-literal"> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> </li> </ul> </li> </ul> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <p>number of buckets in results</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getaveragesize" class="tsd-anchor"></a> <h3>get<wbr>Average<wbr>Size</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Average<wbr>Size<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L518">code/spatial-hash.ts:518</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>helper function to evaluate hash table</p> </div> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <ul> <li>the average number of entries in each bucket</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getbuckets" class="tsd-anchor"></a> <h3>get<wbr>Buckets</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Buckets<span class="tsd-signature-symbol">(</span>minimum<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L301">code/spatial-hash.ts:301</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>returns an array of buckets with &gt;= minimum of objects in each bucket</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>minimum: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 1</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></h4> <p>array of buckets</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getlargest" class="tsd-anchor"></a> <h3>get<wbr>Largest</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Largest<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L530">code/spatial-hash.ts:530</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>helper function to evaluate the hash table</p> </div> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <ul> <li>the largest sized bucket</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getnumberofbuckets" class="tsd-anchor"></a> <h3>get<wbr>Number<wbr>OfBuckets</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Number<wbr>OfBuckets<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L510">code/spatial-hash.ts:510</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>helper function to evaluate hash table</p> </div> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <ul> <li>the number of buckets in the hash table</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getsparseness" class="tsd-anchor"></a> <h3>get<wbr>Sparseness</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>Sparseness<span class="tsd-signature-symbol">(</span>AABB<span class="tsd-signature-symbol">?: </span><a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L563">code/spatial-hash.ts:563</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>helper function to evaluate the hash table</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> AABB: <a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4> <ul> <li>sparseness percentage (i.e., buckets with at least 1 element divided by total possible buckets)</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="getworldbounds" class="tsd-anchor"></a> <h3>get<wbr>World<wbr>Bounds</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">get<wbr>World<wbr>Bounds<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">SpatialHashBounds</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L544">code/spatial-hash.ts:544</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>gets quadrant bounds</p> </div> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">SpatialHashBounds</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="insert" class="tsd-anchor"></a> <h3>insert</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">insert<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a>, key<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L331">code/spatial-hash.ts:331</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>insert object into the spatial hash automatically called from updateObject()</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h5> </li> <li> <h5>key: <span class="tsd-signature-type">string</span></h5> <div class="tsd-comment tsd-typography"> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="invisible" class="tsd-anchor"></a> <h3>invisible</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">invisible<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L198">code/spatial-hash.ts:198</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>set all objects in hash to visible=false</p> </div> </div> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="neighbors" class="tsd-anchor"></a> <h3>neighbors</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">neighbors<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L359">code/spatial-hash.ts:359</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>get all neighbors that share the same hash as object</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h5> <div class="tsd-comment tsd-typography"> <p>in the spatial hash</p> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">[]</span></h4> <ul> <li>of objects that are in the same hash as object</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="query" class="tsd-anchor"></a> <h3>query</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">query<span class="tsd-signature-symbol">(</span>AABB<span class="tsd-signature-symbol">: </span><a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a>, simpleTest<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L371">code/spatial-hash.ts:371</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>returns an array of objects contained within bounding box</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>AABB: <a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a></h5> <div class="tsd-comment tsd-typography"> <p>bounding box to search</p> </div> </li> <li> <h5>simpleTest: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">[]</span></h4> <ul> <li>search results</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="querycallback" class="tsd-anchor"></a> <h3>query<wbr>Callback</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">query<wbr>Callback<span class="tsd-signature-symbol">(</span>AABB<span class="tsd-signature-symbol">: </span><a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a>, callback<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">boolean</span>, simpleTest<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L450">code/spatial-hash.ts:450</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>iterates through objects contained within bounding box stops iterating if the callback returns true</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>AABB: <a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a></h5> <div class="tsd-comment tsd-typography"> <p>bounding box to search</p> </div> </li> <li> <h5>callback: <span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">boolean</span></h5> <ul class="tsd-parameters"> <li class="tsd-parameter-signature"> <ul class="tsd-signatures tsd-kind-type-literal"> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> </li> </ul> </li> </ul> </li> <li> <h5>simpleTest: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> <ul> <li>true if callback returned early</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="querycallbackall" class="tsd-anchor"></a> <h3>query<wbr>Callback<wbr>All</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">query<wbr>Callback<wbr>All<span class="tsd-signature-symbol">(</span>AABB<span class="tsd-signature-symbol">: </span><a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a>, simpleTest<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">boolean</span>, callback<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">[]</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L409">code/spatial-hash.ts:409</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>returns an array of objects contained within bounding box with a callback on each non-culled object this function is different from queryCallback, which cancels the query when a callback returns true</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>AABB: <a href="../interfaces/aabb.html" class="tsd-signature-type" data-tsd-kind="Interface">AABB</a></h5> <div class="tsd-comment tsd-typography"> <p>bounding box to search</p> </div> </li> <li> <h5>simpleTest: <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = true</span></h5> </li> <li> <h5>callback: <span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> =&gt; </span><span class="tsd-signature-type">boolean</span></h5> <div class="tsd-comment tsd-typography"> <p>function to run for each non-culled object</p> </div> <ul class="tsd-parameters"> <li class="tsd-parameter-signature"> <ul class="tsd-signatures tsd-kind-type-literal"> <li class="tsd-signature tsd-kind-icon"><span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">boolean</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</span></h4> </li> </ul> </li> </ul> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">[]</span></h4> <ul> <li>search results</li> </ul> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="remove" class="tsd-anchor"></a> <h3>remove</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">remove<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L121">code/spatial-hash.ts:121</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>remove an object added by add()</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h4> <p>object</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="removecontainer" class="tsd-anchor"></a> <h3>remove<wbr>Container</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">remove<wbr>Container<span class="tsd-signature-symbol">(</span>container<span class="tsd-signature-symbol">: </span><a href="../interfaces/containerwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">ContainerWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/containerwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">ContainerWithCulling</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L164">code/spatial-hash.ts:164</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>remove an array added by addContainer()</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>container: <a href="../interfaces/containerwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">ContainerWithCulling</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <a href="../interfaces/containerwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">ContainerWithCulling</a></h4> <p>container</p> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="removefromhash" class="tsd-anchor"></a> <h3>remove<wbr>From<wbr>Hash</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">remove<wbr>From<wbr>Hash<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L345">code/spatial-hash.ts:345</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>removes object from the hash table should be called when removing an object automatically called from updateObject()</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h5> <div class="tsd-comment tsd-typography"> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="stats" class="tsd-anchor"></a> <h3>stats</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">stats<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="../interfaces/spatialhashstats.html" class="tsd-signature-type" data-tsd-kind="Interface">SpatialHashStats</a></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L482">code/spatial-hash.ts:482</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Get stats</p> </div> </div> <h4 class="tsd-returns-title">Returns <a href="../interfaces/spatialhashstats.html" class="tsd-signature-type" data-tsd-kind="Interface">SpatialHashStats</a></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="updateobject" class="tsd-anchor"></a> <h3>update<wbr>Object</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">update<wbr>Object<span class="tsd-signature-symbol">(</span>object<span class="tsd-signature-symbol">: </span><a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L261">code/spatial-hash.ts:261</a></li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>update the has of an object automatically called from updateObjects()</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5>object: <a href="../interfaces/displayobjectwithculling.html" class="tsd-signature-type" data-tsd-kind="Interface">DisplayObjectWithCulling</a></h5> <div class="tsd-comment tsd-typography"> </div> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4> </li> </ul> </section> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"> <a name="updateobjects" class="tsd-anchor"></a> <h3>update<wbr>Objects</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class"> <li class="tsd-signature tsd-kind-icon">update<wbr>Objects<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in <a href="https://github.com/davidfig/pixi-cull/blob/95b278e/code/spatial-hash.ts#L215"