UNPKG

windowmanager

Version:

A framework to manage multiple dockable, HTML windows

4,090 lines (999 loc) 55 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>BoundingBox - Documentation</title> <script src="scripts/prettify/prettify.js"></script> <script src="scripts/prettify/lang-css.js"></script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css"> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <input type="checkbox" id="nav-trigger" class="nav-trigger" /> <label for="nav-trigger" class="navicon-button x"> <div class="navicon"></div> </label> <label for="nav-trigger" class="overlay"></label> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BoundingBox.html">BoundingBox</a><ul class='methods'><li data-type='method'><a href="BoundingBox.html#clone">clone</a></li><li data-type='method'><a href="BoundingBox.html#difference">difference</a></li><li data-type='method'><a href="BoundingBox.html#getArea">getArea</a></li><li data-type='method'><a href="BoundingBox.html#getBoundingBox">getBoundingBox</a></li><li data-type='method'><a href="BoundingBox.html#getCenteredOnPosition">getCenteredOnPosition</a></li><li data-type='method'><a href="BoundingBox.html#getCenterPosition">getCenterPosition</a></li><li data-type='method'><a href="BoundingBox.html#getColliding">getColliding</a></li><li data-type='method'><a href="BoundingBox.html#getCollisionMesh">getCollisionMesh</a></li><li data-type='method'><a href="BoundingBox.html#getDistanceSquaredToPoint">getDistanceSquaredToPoint</a></li><li data-type='method'><a href="BoundingBox.html#getDistanceToPoint">getDistanceToPoint</a></li><li data-type='method'><a href="BoundingBox.html#getEdgeClosest">getEdgeClosest</a></li><li data-type='method'><a href="BoundingBox.html#getEdgeClosestOrder">getEdgeClosestOrder</a></li><li data-type='method'><a href="BoundingBox.html#getEdgeTouching">getEdgeTouching</a></li><li data-type='method'><a href="BoundingBox.html#getHeight">getHeight</a></li><li data-type='method'><a href="BoundingBox.html#getIntersection">getIntersection</a></li><li data-type='method'><a href="BoundingBox.html#getOtherEdgeTouching">getOtherEdgeTouching</a></li><li data-type='method'><a href="BoundingBox.html#getPosition">getPosition</a></li><li data-type='method'><a href="BoundingBox.html#getSize">getSize</a></li><li data-type='method'><a href="BoundingBox.html#getSnapDelta">getSnapDelta</a></li><li data-type='method'><a href="BoundingBox.html#getWidth">getWidth</a></li><li data-type='method'><a href="BoundingBox.html#isColliding">isColliding</a></li><li data-type='method'><a href="BoundingBox.html#isContains">isContains</a></li><li data-type='method'><a href="BoundingBox.html#isNaN">isNaN</a></li><li data-type='method'><a href="BoundingBox.html#isTouching">isTouching</a></li><li data-type='method'><a href="BoundingBox.html#moveBy">moveBy</a></li><li data-type='method'><a href="BoundingBox.html#moveTo">moveTo</a></li><li data-type='method'><a href="BoundingBox.html#resizeTo">resizeTo</a></li><li data-type='method'><a href="BoundingBox.html#set">set</a></li><li data-type='method'><a href="BoundingBox.html#someColliding">someColliding</a></li><li data-type='method'><a href="BoundingBox.html#someContains">someContains</a></li><li data-type='method'><a href="BoundingBox.html#someTouching">someTouching</a></li></ul></li><li><a href="CollisionMesh.html">CollisionMesh</a><ul class='methods'><li data-type='method'><a href="CollisionMesh.html#clone">clone</a></li><li data-type='method'><a href="CollisionMesh.html#getBoundingBox">getBoundingBox</a></li><li data-type='method'><a href="CollisionMesh.html#getColliding">getColliding</a></li><li data-type='method'><a href="CollisionMesh.html#getCollisionMesh">getCollisionMesh</a></li><li data-type='method'><a href="CollisionMesh.html#getHeight">getHeight</a></li><li data-type='method'><a href="CollisionMesh.html#getPosition">getPosition</a></li><li data-type='method'><a href="CollisionMesh.html#getSize">getSize</a></li><li data-type='method'><a href="CollisionMesh.html#getWidth">getWidth</a></li><li data-type='method'><a href="CollisionMesh.html#isColliding">isColliding</a></li><li data-type='method'><a href="CollisionMesh.html#isContains">isContains</a></li><li data-type='method'><a href="CollisionMesh.html#isTouching">isTouching</a></li><li data-type='method'><a href="CollisionMesh.html#moveBy">moveBy</a></li><li data-type='method'><a href="CollisionMesh.html#moveTo">moveTo</a></li><li data-type='method'><a href="CollisionMesh.html#someColliding">someColliding</a></li><li data-type='method'><a href="CollisionMesh.html#someContains">someContains</a></li><li data-type='method'><a href="CollisionMesh.html#someTouching">someTouching</a></li></ul></li><li><a href="EventHandler.html">EventHandler</a><ul class='methods'><li data-type='method'><a href="EventHandler.html#addPipe">addPipe</a></li><li data-type='method'><a href="EventHandler.html#clearEvent">clearEvent</a></li><li data-type='method'><a href="EventHandler.html#emit">emit</a></li><li data-type='method'><a href="EventHandler.html#off">off</a></li><li data-type='method'><a href="EventHandler.html#on">on</a></li><li data-type='method'><a href="EventHandler.html#once">once</a></li><li data-type='method'><a href="EventHandler.html#removePipe">removePipe</a></li></ul></li><li><a href="Position.html">Position</a></li><li><a href="Size.html">Size</a></li><li><a href="Vector.html">Vector</a><ul class='methods'><li data-type='method'><a href="Vector.html#add">add</a></li><li data-type='method'><a href="Vector.html#clone">clone</a></li><li data-type='method'><a href="Vector.html#distance">distance</a></li><li data-type='method'><a href="Vector.html#distanceSquared">distanceSquared</a></li><li data-type='method'><a href="Vector.html#getBoundingBox">getBoundingBox</a></li><li data-type='method'><a href="Vector.html#getCollisionMesh">getCollisionMesh</a></li><li data-type='method'><a href="Vector.html#getVector">getVector</a></li><li data-type='method'><a href="Vector.html#isNaN">isNaN</a></li><li data-type='method'><a href="Vector.html#moveBy">moveBy</a></li><li data-type='method'><a href="Vector.html#moveTo">moveTo</a></li><li data-type='method'><a href="Vector.html#set">set</a></li><li data-type='method'><a href="Vector.html#setMax">setMax</a></li><li data-type='method'><a href="Vector.html#setMin">setMin</a></li><li data-type='method'><a href="Vector.html#subtract">subtract</a></li></ul></li><li><a href="Window.html">Window</a><ul class='methods'><li data-type='method'><a href="Window.html#.getAll">getAll</a></li><li data-type='method'><a href="Window.html#.getByID">getByID</a></li><li data-type='method'><a href="Window.html#.getCurrent">getCurrent</a></li><li data-type='method'><a href="Window.html#addPipe">addPipe</a></li><li data-type='method'><a href="Window.html#bringToFront">bringToFront</a></li><li data-type='method'><a href="Window.html#clearEvent">clearEvent</a></li><li data-type='method'><a href="Window.html#close">close</a></li><li data-type='method'><a href="Window.html#dock">dock</a></li><li data-type='method'><a href="Window.html#emit">emit</a></li><li data-type='method'><a href="Window.html#focus">focus</a></li><li data-type='method'><a href="Window.html#getBounds">getBounds</a></li><li data-type='method'><a href="Window.html#getHeight">getHeight</a></li><li data-type='method'><a href="Window.html#getPosition">getPosition</a></li><li data-type='method'><a href="Window.html#getSize">getSize</a></li><li data-type='method'><a href="Window.html#getTitle">getTitle</a></li><li data-type='method'><a href="Window.html#getWidth">getWidth</a></li><li data-type='method'><a href="Window.html#hide">hide</a></li><li data-type='method'><a href="Window.html#isClosed">isClosed</a></li><li data-type='method'><a href="Window.html#isHidden">isHidden</a></li><li data-type='method'><a href="Window.html#isMaximized">isMaximized</a></li><li data-type='method'><a href="Window.html#isMinimized">isMinimized</a></li><li data-type='method'><a href="Window.html#isReady">isReady</a></li><li data-type='method'><a href="Window.html#isRestored">isRestored</a></li><li data-type='method'><a href="Window.html#isShown">isShown</a></li><li data-type='method'><a href="Window.html#maximize">maximize</a></li><li data-type='method'><a href="Window.html#minimize">minimize</a></li><li data-type='method'><a href="Window.html#moveBy">moveBy</a></li><li data-type='method'><a href="Window.html#moveTo">moveTo</a></li><li data-type='method'><a href="Window.html#off">off</a></li><li data-type='method'><a href="Window.html#on">on</a></li><li data-type='method'><a href="Window.html#once">once</a></li><li data-type='method'><a href="Window.html#onReady">onReady</a></li><li data-type='method'><a href="Window.html#removePipe">removePipe</a></li><li data-type='method'><a href="Window.html#resizeTo">resizeTo</a></li><li data-type='method'><a href="Window.html#restore">restore</a></li><li data-type='method'><a href="Window.html#setBounds">setBounds</a></li><li data-type='method'><a href="Window.html#setTitle">setTitle</a></li><li data-type='method'><a href="Window.html#show">show</a></li><li data-type='method'><a href="Window.html#undock">undock</a></li></ul></li></ul><h3>Namespaces</h3><ul><li><a href="geometry.html">geometry</a></li><li><a href="messagebus.html">messagebus</a><ul class='methods'><li data-type='method'><a href="messagebus.html#.off">off</a></li><li data-type='method'><a href="messagebus.html#.on">on</a></li><li data-type='method'><a href="messagebus.html#.send">send</a></li></ul></li><li><a href="windowmanager.html">windowmanager</a><ul class='methods'><li data-type='method'><a href="windowmanager.html#.isReady">isReady</a></li><li data-type='method'><a href="windowmanager.html#.onReady">onReady</a></li></ul></li></ul><h3><a href="global.html">Global</a></h3> </nav> <div id="main"> <h1 class="page-title">BoundingBox</h1> <section> <header> <h2> BoundingBox </h2> <div class="class-description"><p>A BoundingBox class.</p></div> </header> <article> <div class="container-overview"> <h2>Constructor</h2> <h4 class="name" id="BoundingBox"><span class="type-signature"></span>new BoundingBox<span class="signature">(left, top, right, bottom)</span><span class="type-signature"></span></h4> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>left</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The left position of x-axis.</p></td> </tr> <tr> <td class="name"><code>top</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The top position of y-axis.</p></td> </tr> <tr> <td class="name"><code>right</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The right position of x-axis.</p></td> </tr> <tr> <td class="name"><code>bottom</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>The bottom position of y-axis.</p></td> </tr> </tbody> </table> <dl class="details"> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id="clone"><span class="type-signature"></span>clone<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="BoundingBox.html">BoundingBox</a>}</span></h4> <div class="description"> <p>Clone the current boundingbox to a new object.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>A clone of this instance</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </dd> </dl> <h4 class="name" id="difference"><span class="type-signature"></span>difference<span class="signature">(other)</span><span class="type-signature"> &rarr; {<a href="Vector.html">Vector</a>}</span></h4> <div class="description"> <p>Returns <code>this</code> subtract <code>other</code>.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>position</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="Vector.html">Vector</a></span> </dd> </dl> <h4 class="name" id="getArea"><span class="type-signature"></span>getArea<span class="signature">()</span><span class="type-signature"> &rarr; {Number}</span></h4> <div class="description"> <p>Returns the area of <code>this</code>.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>area</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="getBoundingBox"><span class="type-signature"></span>getBoundingBox<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="BoundingBox.html">BoundingBox</a>}</span></h4> <div class="description"> <p>Resolve this object down to a <a href="BoundingBox.html">BoundingBox</a> instance. Since this instance is already a boundingbox, it returns itself.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>self</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </dd> </dl> <h4 class="name" id="getCenteredOnPosition"><span class="type-signature"></span>getCenteredOnPosition<span class="signature">(other)</span><span class="type-signature"> &rarr; {<a href="Vector.html">Vector</a>}</span></h4> <div class="description"> <p>Returns a position, which if <code>this</code> is set to, <code>this</code> will be centered on <code>other</code>.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>position</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="Vector.html">Vector</a></span> </dd> </dl> <h4 class="name" id="getCenterPosition"><span class="type-signature"></span>getCenterPosition<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Vector.html">Vector</a>}</span></h4> <div class="description"> <p>Returns the center position of <code>this</code>.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>position</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="Vector.html">Vector</a></span> </dd> </dl> <h4 class="name" id="getColliding"><span class="type-signature"></span>getColliding<span class="signature">(others)</span><span class="type-signature"> &rarr; {<a href="BoundingBox.html">BoundingBox</a>|undefined}</span></h4> <div class="description"> <p>Returns which of <code>other</code> that <code>this</code> intersects an area of, not an edge.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>others</code></td> <td class="type"> <span class="param-type">Array.&lt;<a href="BoundingBox.html">BoundingBox</a>></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> | <span class="param-type">undefined</span> </dd> </dl> <h4 class="name" id="getCollisionMesh"><span class="type-signature"></span>getCollisionMesh<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="CollisionMesh.html">CollisionMesh</a>}</span></h4> <div class="description"> <p>Returns a <a href="CollisionMesh.html">CollisionMesh</a> instance version of this boundingbox similar to:<br></p> <pre class="prettyprint source lang-javascript"><code>new CollisionMesh(BoundingBox)</code></pre> </div> <dl class="details"> </dl> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="CollisionMesh.html">CollisionMesh</a></span> </dd> </dl> <h4 class="name" id="getDistanceSquaredToPoint"><span class="type-signature"></span>getDistanceSquaredToPoint<span class="signature">(other)</span><span class="type-signature"> &rarr; {Number}</span></h4> <div class="description"> <p>Returns the squared distance between <code>this</code> and <code>other</code>.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="Vector.html">Vector</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>squared distance</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="getDistanceToPoint"><span class="type-signature"></span>getDistanceToPoint<span class="signature">(other)</span><span class="type-signature"> &rarr; {Number}</span></h4> <div class="description"> <p>Returns the distance between <code>this</code> and <code>other</code>.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="Vector.html">Vector</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>distance</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="getEdgeClosest"><span class="type-signature"></span>getEdgeClosest<span class="signature">(other)</span><span class="type-signature"> &rarr; {String}</span></h4> <div class="description"> <p>Determines which <code>this</code> edge is closest to <code>other</code>.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>edge name</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">String</span> </dd> </dl> <h4 class="name" id="getEdgeClosestOrder"><span class="type-signature"></span>getEdgeClosestOrder<span class="signature">(other)</span><span class="type-signature"> &rarr; {Array.&lt;String>}</span></h4> <div class="description"> <p>Determines which edges of <code>this</code> is closest to <code>other</code>, returns all edges in sorted order by distance.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>edge names sorted from closest to furthest</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Array.&lt;String></span> </dd> </dl> <h4 class="name" id="getEdgeTouching"><span class="type-signature"></span>getEdgeTouching<span class="signature">(others)</span><span class="type-signature"> &rarr; {String|undefined}</span></h4> <div class="description"> <p>If <code>this</code> touches one of <code>others</code>, but does not intersect area, then this returns the <code>this</code> edge name.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>others</code></td> <td class="type"> <span class="param-type">Array.&lt;<a href="BoundingBox.html">BoundingBox</a>></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>edge name</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">String</span> | <span class="param-type">undefined</span> </dd> </dl> <h4 class="name" id="getHeight"><span class="type-signature"></span>getHeight<span class="signature">()</span><span class="type-signature"> &rarr; {Number}</span></h4> <div class="description"> <p>Returns the height of <code>this</code>.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>height</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="getIntersection"><span class="type-signature"></span>getIntersection<span class="signature">(other)</span><span class="type-signature"> &rarr; {<a href="Vector.html">Vector</a>|<a href="BoundingBox.html">BoundingBox</a>|undefined}</span></h4> <div class="description"> <p>Returns the intersection between <code>this</code> and <code>other</code>. This will return a <a href="Vector.html">Vector</a> if they only intersect at a point. This will return a <a href="BoundingBox.html">BoundingBox</a> if they intersect over an area or line. This will return a undefined if they do not intersect.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>intersection object</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="Vector.html">Vector</a></span> | <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> | <span class="param-type">undefined</span> </dd> </dl> <h4 class="name" id="getOtherEdgeTouching"><span class="type-signature"></span>getOtherEdgeTouching<span class="signature">(others)</span><span class="type-signature"> &rarr; {String|undefined}</span></h4> <div class="description"> <p>If <code>this</code> touches one of <code>others</code>, but does not intersect area, then this returns the <code>other</code> edge name.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>others</code></td> <td class="type"> <span class="param-type">Array.&lt;<a href="BoundingBox.html">BoundingBox</a>></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>edge name</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">String</span> | <span class="param-type">undefined</span> </dd> </dl> <h4 class="name" id="getPosition"><span class="type-signature"></span>getPosition<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Vector.html">Vector</a>}</span></h4> <div class="description"> <p>Returns the position of <code>this</code>.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>position</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="Vector.html">Vector</a></span> </dd> </dl> <h4 class="name" id="getSize"><span class="type-signature"></span>getSize<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="Vector.html">Vector</a>}</span></h4> <div class="description"> <p>Returns the size of <code>this</code>.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>size</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="Vector.html">Vector</a></span> </dd> </dl> <h4 class="name" id="getSnapDelta"><span class="type-signature"></span>getSnapDelta<span class="signature">(other, snapDistance<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="Vector.html">Vector</a>}</span></h4> <div class="description"> <p>Returns a vector representing the delta position to add to <code>this</code> to snap to <code>other</code>.<br> Note: <code>snapDelta</code> may contain <code>NaN</code> for <code>left</code> or <code>right</code></p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </td> <td class="attributes"> </td> <td class="default"> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>snapDistance</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 5 </td> <td class="description last"><p>max distance to move <code>this</code></p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>snapDelta</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="Vector.html">Vector</a></span> </dd> </dl> <h4 class="name" id="getWidth"><span class="type-signature"></span>getWidth<span class="signature">()</span><span class="type-signature"> &rarr; {Number}</span></h4> <div class="description"> <p>Returns the width of <code>this</code>.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>width</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Number</span> </dd> </dl> <h4 class="name" id="isColliding"><span class="type-signature"></span>isColliding<span class="signature">(other)</span><span class="type-signature"> &rarr; {Boolean}</span></h4> <div class="description"> <p>Determines if <code>this</code> intersects an area of <code>others</code>, not an edge.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Boolean</span> </dd> </dl> <h4 class="name" id="isContains"><span class="type-signature"></span>isContains<span class="signature">(other)</span><span class="type-signature"> &rarr; {Boolean}</span></h4> <div class="description"> <p>Determines if <code>this</code> encapsulates <code>other</code>.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Boolean</span> </dd> </dl> <h4 class="name" id="isNaN"><span class="type-signature"></span>isNaN<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h4> <div class="description"> <p>Checks if any property on <code>this</code> is NaN.</p> </div> <dl class="details"> </dl> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Boolean</span> </dd> </dl> <h4 class="name" id="isTouching"><span class="type-signature"></span>isTouching<span class="signature">(other)</span><span class="type-signature"> &rarr; {Boolean}</span></h4> <div class="description"> <p>Determines if <code>this</code> touches an edge of <code>other</code>, but does not intersect area.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td class="type"> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type">Boolean</span> </dd> </dl> <h4 class="name" id="moveBy"><span class="type-signature"></span>moveBy<span class="signature">(deltaLeft<span class="signature-attributes">opt</span>, deltaTop<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="BoundingBox.html">BoundingBox</a>}</span></h4> <div class="description"> <p>Move <code>this</code> relatively to position by <code>deltaLeft</code> and/or <code>deltaTop</code>.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>deltaLeft</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> null </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>deltaTop</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> null </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>self</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </dd> </dl> <h4 class="name" id="moveTo"><span class="type-signature"></span>moveTo<span class="signature">(left<span class="signature-attributes">opt</span>, top<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="BoundingBox.html">BoundingBox</a>}</span></h4> <div class="description"> <p>Move <code>this</code> to position at <code>left</code> and/or <code>top</code>.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>left</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> null </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>top</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> null </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>self</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </dd> </dl> <h4 class="name" id="resizeTo"><span class="type-signature"></span>resizeTo<span class="signature">(width<span class="signature-attributes">opt</span>, height<span class="signature-attributes">opt</span>, anchor<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="BoundingBox.html">BoundingBox</a>}</span></h4> <div class="description"> <p>Resize <code>this</code> to size <code>width</code> and/or <code>height</code>, anchored at <code>anchor</code>.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th>Attributes</th> <th>Default</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>width</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> null </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>height</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> null </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>anchor</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="attributes"> &lt;optional><br> </td> <td class="default"> 'top-left' </td> <td class="description last"><p>supports &quot;top-left&quot;, &quot;top-right&quot;, &quot;bottom-left&quot;, or &quot;bottom-right&quot;</p></td> </tr> </tbody> </table> <dl class="details"> </dl> <h5>Returns:</h5> <div class="param-desc"> <p>self</p> </div> <dl class="param-type"> <dt> Type </dt> <dd> <span class="param-type"><a href="BoundingBox.html">BoundingBox</a></span> </dd> </dl> <h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(other)</span><span class="type-signature"> &rarr; {<a href="BoundingBox.html">BoundingBox</a>}</span></h4> <div class="description"> <p>Sets <code>this</code>'s properties to <code>other</code>'s properties.</p> </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>other</code></td> <td cla